Build: #1 failed
Job: Pipeline PR Test 6.7.4 failed
file operation failure cleanup: Test case result
The below summarizes the result of the test " file operation failure cleanup" in build 1 of PIPESPECS - Pipeline Pull Request Test - PIPE-3094-new-mstransform-based-hanning-smoothing-breaks-backward-compatibility-of-vla-restores - Pipeline PR Test 6.7.4.
- Description
- file operation failure cleanup
- Test class
- pipeline.hifv.tasks.hanning.hanning_test.TestHanningPrepare
- Method
- test_file_operation_failure_cleanup
- Duration
- < 1 sec
- Status
- Failed (New Failure)
Error Log
assert True is False
+ where True = <pipeline.hifv.tasks.hanning.hanning.HanningResults object at 0x7f72a13d38c0>.task_successful
self = <pipeline.hifv.tasks.hanning.hanning_test.TestHanningPrepare object at 0x7f72a1a816a0>
mock_table_reader = <MagicMock name='TableReader' id='140130307072576'>
mock_exists = <MagicMock name='exists' id='140130308141808'>
mock_rmtree = <MagicMock name='rmtree' id='140130306952464'>
mock_rename = <MagicMock name='rename' id='140130308892832'>
@patch('pipeline.hifv.tasks.hanning.hanning.os.rename')
@patch('pipeline.hifv.tasks.hanning.hanning.shutil.rmtree')
@patch('pipeline.hifv.tasks.hanning.hanning.os.path.exists')
@patch('pipeline.hifv.tasks.hanning.hanning.casa_tools.TableReader')
def test_file_operation_failure_cleanup(
self,
mock_table_reader: MagicMock,
mock_exists: MagicMock,
mock_rmtree: MagicMock,
mock_rename: MagicMock,
) -> None:
"""Test cleanup logic when file operations fail."""
mock_table = MagicMock()
mock_table.colnames.return_value = []
mock_table_reader.return_value.__enter__.return_value = mock_table
ms = MagicMock()
spw = MagicMock()
spw.id = 0
spw.sdm_num_bin = 0
spw.specline_window = False
ms.get_spectral_windows.return_value = [spw]
self.context.observing_run.get_ms.return_value = ms
# Simulate temp MS exists initially but removal fails
mock_exists.side_effect = [True, False, True, False] # temp exists, then doesn't
mock_rmtree.side_effect = OSError('Permission denied')
hanning_task = Hanning(inputs=self.inputs)
with patch.object(hanning_task, '_do_hanningsmooth'):
with patch.object(hanning_task, '_track_hsmooth'):
results = hanning_task.prepare()
> assert results.task_successful is False
E assert True is False
E + where True = <pipeline.hifv.tasks.hanning.hanning.HanningResults object at 0x7f72a13d38c0>.task_successful
hifv/tasks/hanning/hanning_test.py:222: AssertionError