Test: restart while the database is away still catches up once it answers (T2 order)
CI / Test (pytest) (pull_request) Successful in 52s
CI / Integration (MariaDB) (pull_request) Successful in 1m50s
CI / Security (bandit, pip-audit) (pull_request) Successful in 1m4s
CI / Lint (flake8, house style) (pull_request) Successful in 58s
CI / Scan (secrets, workflows, shell, patterns) (pull_request) Successful in 2m57s
CI / Deploy (pull_request) Skipped
CI / Test (pytest) (pull_request) Successful in 52s
CI / Integration (MariaDB) (pull_request) Successful in 1m50s
CI / Security (bandit, pip-audit) (pull_request) Successful in 1m4s
CI / Lint (flake8, house style) (pull_request) Successful in 58s
CI / Scan (secrets, workflows, shell, patterns) (pull_request) Successful in 2m57s
CI / Deploy (pull_request) Skipped
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
b0e240af50
commit
f3d0b5e11a
2 files changed
+20
No files matched your search
@@ -176,3 +176,21 @@ def test_stop_ends_run_forever():
|
||||
m.settings.cycle_seconds = 1
|
||||
m.stop()
|
||||
m.run_forever() # returns at once
|
||||
|
||||
|
||||
def test_restart_while_db_away_still_catches_up_once_db_answers():
|
||||
"""T2 order: the rack comes back, Thor starts before CT 149 does."""
|
||||
store = FakeStore()
|
||||
m, clock = make(store)
|
||||
m.cycle()
|
||||
went_dark = clock.t
|
||||
clock.advance(22 * 60)
|
||||
store.down = True
|
||||
m2, _ = make(store, clock=clock)
|
||||
first = m2.cycle()
|
||||
assert first.window == (clock.t - 120, clock.t) # nothing known yet
|
||||
clock.advance(120)
|
||||
store.down = False
|
||||
second = m2.cycle()
|
||||
# The stored end wins, so the whole time Thor was away is reviewed, not just the last cycle.
|
||||
assert second.window == (went_dark, clock.t) and second.catching_up
|
||||
Reference in new issue
Block a user