Steps to reproduce
Sometimes, when running CI on Github Actions, PRs report failures on the test_checksum unit test. The failures seem to be spurious, since re-running the same tests usually makes them pass.
Error message
==================================== ERRORS ====================================
__ ERROR at teardown of test_checksum[arguments0-versions of preferred-test] ___
request = <SubRequest 'check_for_leftover_stage_files' for <Function test_checksum[arguments0-versions of preferred-test]>>
mock_stage = '/tmp/pytest-of-runner/pytest-0/mock-stage2'
ignore_stage_files = {'.lock', 'build_cache', 'spack-src', 'spack-stage-j44yj070'}
@pytest.fixture(scope='function', autouse=True)
def check_for_leftover_stage_files(request, mock_stage, ignore_stage_files):
"""
Ensure that each (mock_stage) test leaves a clean stage when done.
Tests that are expected to dirty the stage can disable the check by
adding::
@pytest.mark.disable_clean_stage_check
and the associated stage files will be removed.
"""
stage_path = mock_stage
yield
files_in_stage = set()
try:
stage_files = os.listdir(stage_path)
files_in_stage = set(stage_files) - ignore_stage_files
except OSError as err:
if err.errno == errno.ENOENT:
pass
else:
raise
if 'disable_clean_stage_check' in request.keywords:
# clean up after tests that are expected to be dirty
for f in files_in_stage:
path = os.path.join(stage_path, f)
remove_whatever_it_is(path)
else:
ignore_stage_files |= files_in_stage
> assert not files_in_stage
E AssertionError: assert not {'spack-stage-j44yj070'}
lib/spack/spack/test/conftest.py:389: AssertionError
Information on your system
The error message was taken from here:
but there are many other similar cases
General information
Steps to reproduce
Sometimes, when running CI on Github Actions, PRs report failures on the
test_checksumunit test. The failures seem to be spurious, since re-running the same tests usually makes them pass.Error message
Information on your system
The error message was taken from here:
but there are many other similar cases
General information
spack debug reportand reported the version of Spack/Python/Platform