Skip to content

Commit c2aed43

Browse files
sbryngelsonclaude
andcommitted
Fix 3 issues from AI review: timeout after restart, stale case.py, float consistency
- Add timeout check after run_restart completes to catch hung restarts - Restore case.py on disk in finally block so test_all mode uses correct params - Use 1.0 instead of 1 for float consistency in direction symmetry tests Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 163822a commit c2aed43

3 files changed

Lines changed: 6 additions & 1 deletion

File tree

toolchain/mfc/test/case.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,7 @@ def run_restart(self, targets, gpus):
171171
return self.run(targets, gpus)
172172
finally:
173173
self.params = orig
174+
self.create_directory()
174175

175176
def get_trace(self) -> str:
176177
return self.trace

toolchain/mfc/test/cases.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1140,7 +1140,7 @@ def direction_symmetry_tests():
11401140
mods[f'patch_icpp({patchID})%length_{direction}'] = lengths[patchID - 1]
11411141
for od in others:
11421142
mods[f'patch_icpp({patchID})%{od}_centroid'] = 0.5
1143-
mods[f'patch_icpp({patchID})%length_{od}'] = 1
1143+
mods[f'patch_icpp({patchID})%length_{od}'] = 1.0
11441144

11451145
stack.push(f'3D Direction Symmetry -> Shock in {direction.upper()}', mods)
11461146
cases.append(define_case_d(stack, '', {}))

toolchain/mfc/test/test.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -393,6 +393,10 @@ def _handle_case(case: TestCase, devices: typing.Set[int]):
393393
raise TestTimeoutError("Test case exceeded 1 hour timeout")
394394

395395
restart_result = case.run_restart([PRE_PROCESS, SIMULATION], devices)
396+
397+
if timeout_flag.is_set():
398+
raise TestTimeoutError("Test case exceeded 1 hour timeout")
399+
396400
out_filepath_restart = os.path.join(case.get_dirpath(), "out_restart.txt")
397401
common.file_write(out_filepath_restart, restart_result.stdout)
398402

0 commit comments

Comments
 (0)