test(prodstyle): make the readiness test async so its required Timeout is enforceable - #349
Merged
Merged
Conversation
…t is enforceable #348 added [Fact(Timeout = TestTimeouts.HostTouching)] to satisfy TimeoutConventionTests, but the test is synchronous and xunit only honours Timeout on Task-returning tests, so the run failed with "Tests marked with Timeout are only supported for async tests" -- kernel-coverage stayed red, one failure traded for another. The convention now requires both halves: a ProdStyle/E2E test must carry an explicit Timeout AND return Task, so an unenforceable timeout is named at convention time instead of at run time. Verified by reverting the test to void: the convention fails with "has [Fact(Timeout = N)] but returns Void; make it async Task". Also collapses the duplicate Fact/Theory branches -- TheoryAttribute derives from FactAttribute, so the first lookup already covered both and a Theory without a timeout was reported twice. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Contributor
Bugbot is not enabled for your account, so this pull request was not reviewed. Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for freeto join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
The kernel-coverage gate has been red on
masterfor every commit since the .NET 10 merge, for two different reasons in the same class:d3d90fabTimeoutConventionTestsFAIL — the readiness test lackedTimeout3a4ae93e(post-#348)Tests marked with Timeout are only supported for async tests#348 added
[Fact(Timeout = TestTimeouts.HostTouching)]to satisfy the convention, butReady_is_503_while_starting_200_once_started_and_503_again_once_stoppingis synchronous, and xunit enforcesTimeoutby racing the returnedTaskagainst a delay — it cannot do that for avoidtest and fails it outright. One red was traded for another.What
Task. Its body is still synchronous (it pins the lifetime transitions onNexoEndpoints.EvaluateReadinessdirectly, as the comment explains); the signature is what xunit needs to honour the timeout.TimeoutConventionTestsnow requires both halves — an explicitTimeoutand aTaskreturn — so an unenforceable timeout is named at convention time rather than turning a passing test into a failing one. Without this the two rules contradict each other, and the nextvoidProdStyle test repeats the outage.Fact/Theorybranches:TheoryAttributederives fromFactAttribute, so the first lookup already matched theories and aTheorywithout a timeout was reported twice.Verification
Locally on net10.0,
TimeoutConventionTests+HealthAndReadinessProdStyleTests: 4 passed, 0 failed.Negative check — reverting the test to
voidmakes the convention fail with the message that names the fix:The other two reds on
master(Distribution Matrix Gate,Docs Link Check) are unrelated infra —Failed to download action … 429/503from codeload.🤖 Generated with Claude Code