Files
lmxopcua/tests/Server
Joseph Doherty ae9d917b73 test(controlplane): #1111 guard-and-flip reopen test: wait for recovery, prove non-vacuity, capture the interleaving
On_sql_server_a_closure_between_guard_and_flip_is_not_reopened failed once with no message. Interleaving
analysis + repro found no product race (the guard-RowVersion-conditioned flip held in every run, and
removing that conditioning makes the test fail), but three test-side defects:

- Vacuous interleaving: ResolveOne returns once PreStart ran, while the recovery load runs after a
  Task.Yield on the pool. A late load could take the interposer's first countdown slot, so the closure
  fired BEFORE the guard read and the test passed without exercising the race. The test now waits for
  ConfigPublishCoordinatorReadiness == Ready and asserts both counted contexts came from DispatchWrites.
- A throwing closure (shared SQL refusing / timing out) surfaced only as a bare "Fired should be true"
  timeout; it is now captured and reported with its exception.
- No context on failure: every assertion now carries a timeline of context hand-outs (offset, thread,
  countdown, calling coordinator frame), the closure outcome and a dump of both rows.

The reproduced failures were all in SqlServerTestDatabase construction: transport errors / connection
refused while the shared central SQL was stopped, and a migration statement (sp_releaseapplock)
overrunning the 30 s default command timeout while several SQL-backed classes migrate in parallel on a
loaded server. Migration now runs with a 300 s command timeout and a 60 s connect timeout.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-12-05 00:45:50 -05:00
..