The storage-switch target check no longer counts the EF model build against its 15-second limit #369

Merged
claude merged 1 commit from feature/351-storage-switch-timeout into develop 2026-11-12 00:47:17 -05:00
Owner

The storage-switch target check no longer counts the EF model build against its 15-second limit. This fixes a test that timed out on a loaded CI runner.

  • Cause: in StorageEngineSwitchService.CheckTargetAsync the 15 s timer started before the NinlilDnsContext was created. The cold EF model build is CPU work that touches no database, and it used up part of the limit.
  • Fix: the model is built first (_ = context.Model;) and the timer starts after it. The limit now covers only what the target database does: one connect and the migrations-history query. No new option; the default stays at 15 s.
  • Red then green: with the timeout forced to 200 ms, ScheduleSwitch_WithNoClusterSetting_IsSaved fails before the fix and passes after it. The coder and the verifier each showed this.
  • Measured by the verifier on a warm host: the model build takes about 700 ms and the timed part about 50 ms.

Verified:

  • StorageSwitchReplicaTests passed 10/10 in the CI container, in the coder's run and in the verifier's.
  • The Storage tests of Ninlil.Web.Tests passed 82/82.
  • The build has 0 warnings and csharpier is clean.
  • No regression test was added: a deterministic one needs a timeout seam, and the verifier agrees it is not worth one.

Closes #351

🤖 Generated with Claude Code

https://claude.ai/code/session_01T33E3pmQvqkTriyQUMNUTK

The storage-switch target check no longer counts the EF model build against its 15-second limit. This fixes a test that timed out on a loaded CI runner. - **Cause:** in `StorageEngineSwitchService.CheckTargetAsync` the 15 s timer started before the `NinlilDnsContext` was created. The cold EF model build is CPU work that touches no database, and it used up part of the limit. - **Fix:** the model is built first (`_ = context.Model;`) and the timer starts after it. The limit now covers only what the target database does: one connect and the migrations-history query. No new option; the default stays at 15 s. - **Red then green:** with the timeout forced to 200 ms, `ScheduleSwitch_WithNoClusterSetting_IsSaved` fails before the fix and passes after it. The coder and the verifier each showed this. - **Measured** by the verifier on a warm host: the model build takes about 700 ms and the timed part about 50 ms. **Verified:** - `StorageSwitchReplicaTests` passed 10/10 in the CI container, in the coder's run and in the verifier's. - The Storage tests of `Ninlil.Web.Tests` passed 82/82. - The build has 0 warnings and csharpier is clean. - No regression test was added: a deterministic one needs a timeout seam, and the verifier agrees it is not worth one. Closes #351 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01T33E3pmQvqkTriyQUMNUTK
The storage switch target check starts its 15 second timer after the EF model is built, so a loaded host no longer fails it
Some checks failed
Build / Pack and Push NuGet Packages (dhcp) (pull_request) Successful in -2m2s
Build / Pack and Push NuGet Packages (dns-core) (pull_request) Successful in -1m49s
Build / Pack and Push NuGet Packages (dns-server) (pull_request) Successful in -1m59s
Build / Pack and Push NuGet Packages (common) (push) Has been skipped
Build / Pack and Push NuGet Packages (dhcp) (push) Has been skipped
Build / Pack and Push NuGet Packages (dns-server) (push) Has been skipped
Build / Stage Draft Release (push) Has been skipped
Build / Pack and Push NuGet Packages (dns-core) (push) Has been skipped
Build / Build Binary (linux-amd64) (pull_request) Successful in -1m11s
Build / Build Binary (linux-arm64) (pull_request) Successful in -1m15s
Build / Build Binary (macos-amd64) (pull_request) Successful in -1m2s
Build / Build Binary (linux-amd64) (push) Has been skipped
Build / Build Binary (macos-arm64) (push) Has been skipped
Build / Build Binary (linux-arm64) (push) Has been skipped
Build / Build Binary (macos-amd64) (push) Has been skipped
Build / Build Binary (windows-amd64) (push) Has been skipped
Build / Smoke Test the Windows Binary (push) Has been skipped
Build / Build Binary (windows-amd64) (pull_request) Successful in -29s
Build / Build Binary (macos-arm64) (pull_request) Successful in -25s
Build / Smoke Test the Windows Binary (pull_request) Successful in 15s
Build / Build and Test Deb and RPM Packages (push) Has been skipped
Build / Build Arch Linux Packages (push) Has been skipped
Build / Build and Push Image (push) Has been skipped
Build / Build and Push Image (pull_request) Successful in -2m29s
Build / Build Arch Linux Packages (pull_request) Successful in -2m14s
Build / Build and Test Deb and RPM Packages (pull_request) Successful in -23s
Build / Publish Release (push) Has been skipped
Build / Pipeline (push) Failing after 0s
Build / Pipeline (pull_request) Successful in 0s
Build / Publish Release (pull_request) Successful in -2m16s
9b336b9254
Closes #351

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01T33E3pmQvqkTriyQUMNUTK
claude merged commit 8caff154eb into develop 2026-11-12 00:47:17 -05:00
claude deleted branch feature/351-storage-switch-timeout 2026-11-12 00:47:17 -05:00
Sign in to join this conversation.
No reviewers
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
lantea-one/ninlil!369
No description provided.