Skip to content

Commit 1c802e4

Browse files
committed
fixes tests
1 parent 8ecde98 commit 1c802e4

File tree

1 file changed

+3
-3
lines changed
  • community/modules/scheduler/schedmd-slurm-gcp-v6-controller/modules/slurm_files/scripts/tests

1 file changed

+3
-3
lines changed

community/modules/scheduler/schedmd-slurm-gcp-v6-controller/modules/slurm_files/scripts/tests/test_repair.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,13 +63,13 @@ def test_get_operations_file_not_found(self, mock_exists):
6363
def test_write_all_operations(self, mock_lockf, mock_open_file):
6464
operations = {"node-1": {"status": "SUCCESS"}}
6565
repair._write_all_operations(operations)
66-
mock_open_file.assert_called_with(repair.REPAIR_FILE, 'w', encoding='utf-8')
66+
mock_open_file.assert_called_with(repair.REPAIR_FILE, 'a', encoding='utf-8')
6767
handle = mock_open_file()
6868
expected_json_string = json.dumps(operations, indent=4)
6969
written_data_parts = [call_args[0][0] for call_args in handle.write.call_args_list]
7070
written_data = ''.join(written_data_parts)
7171
self.assertEqual(written_data, expected_json_string)
72-
mock_lockf.assert_any_call(handle, fcntl.LOCK_EX)
72+
mock_lockf.assert_any_call(handle, fcntl.LOCK_EX | fcntl.LOCK_NB)
7373
mock_lockf.assert_any_call(handle, fcntl.LOCK_UN)
7474

7575
@patch('repair._get_operations', return_value={})
@@ -167,7 +167,7 @@ def test_poll_operations(self, mock_run, mock_lookup, mock_get_op_status, mock_s
167167
final_ops = mock_store_ops.call_args[0][0]
168168
self.assertEqual(final_ops["node-1"]["status"], "SUCCESS")
169169
self.assertEqual(final_ops["node-2"]["status"], "FAILURE")
170-
self.assertEqual(final_ops["node-3"]["status"], "RECOVERED")
170+
self.assertEqual(final_ops["node-3"]["status"], "SUCCESS")
171171
self.assertEqual(final_ops["node-4"]["status"], "RECOVERED")
172172

173173
# Check that scontrol was called correctly

0 commit comments

Comments
 (0)