Skip to content

Commit a7f4b84

Browse files
committed
test(eval): cover running marker with no attempt directory
CodeRabbit review on #436: pin the crash window where cell.json records a running attempt but no attempt-NNN directory exists yet, so resume allocates the next number instead of reusing it.
1 parent 683d6cd commit a7f4b84

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

tests/test_model_trials.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,12 @@ def test_attempt_number_does_not_reuse_deleted_highest_attempt(tmp_path):
9191
assert model_trials._attempt_number(tmp_path) == 4
9292

9393

94+
def test_attempt_number_counts_running_marker_without_attempt_dir(tmp_path):
95+
# Crash window: cell.json was written as running before attempt-001 existed.
96+
(tmp_path / "cell.json").write_text(json.dumps({"state": "running", "attempt": 1}))
97+
assert model_trials._attempt_number(tmp_path) == 2
98+
99+
94100
def test_expand_cells_is_stable_and_conditions_change_identity():
95101
first = model_trials.expand_cells(_manifest(), _roster())
96102
second = model_trials.expand_cells(_manifest(), _roster())

0 commit comments

Comments
 (0)