Repository navigation
Custom view panels say a silent store's open timed out, whatever the driver wraps the timeout in, and the open-timeout test names the exception chain when it fails - #5052
Merged
Conversation
…t in; name the exception chain when the open-timeout test fails (follow-up to #5016)
Drop the nested OperationCanceledException exclusion from IsTimedOutByClock (the caller's cancellation is already covered by callerCancelled, and a nested one with a live caller is the driver's own Timeout timer). Pin the open helper's stopwatch, clock call, flag and the FromRunException read with a source test. Read the data source Timeout before the open, outside the catch.
erikdarlingdata
marked this pull request as ready for review
October 3, 2026 22:17
erikdarlingdata
added a commit
that referenced
this pull request
Oct 3, 2026
…2013 (#5052) (#5054) #5052's source pin counted one match with Assert.Equal(1, ....Count), which the xUnit2013 analyzer warns on, so dev built Darling.Tests with 1 warning again. It now uses Assert.Single, with the same assertion: exactly one FailedAfterTimeout = true in the compose open helper. Dev builds with 0 warnings again. Follow-up to #5052
12 of 14 tasks
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 free
to 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.
What changes
CI has twice failed
ComposeOpenPhaseTimeoutTests.ASilentStore_IsAServerError_NotTheStatementTimeoutText(remapClientTimeout: True)on unrelated PRs, because a silent store sometimes answered "could not open a store connection: Exception while reading from stream" instead of "could not get a store connection in time". #5016 says this shape was never reproduced locally, so this PR does two things that do not depend on knowing the shape.RunComposedPanelAsynctakes an optionalonRunExceptioncallback (a test seam on the generic-exception arm, internal and unused by production callers).ComposeOpenPhaseTimeoutTestscaptures the exception and appends each level's type and message, plusSocketException.SocketErrorCodeandIOException.HResult, to the prefix assert's message.OpenComposeConnectionAsynctimes the open. When it fails with anNpgsqlExceptionafter at least the data source's connectionTimeout(minus 100 ms slack), the answer is "in time". This is an OR besidePostgresOpenTimeout.IsTimedOutOpen, whose shape rules are unchanged. APostgresExceptionorOperationCanceledExceptionanywhere in the chain, a cancelled caller token, or a failure well before the timeout (refused, reset, closed, auth) still says "could not open". The rule lives inPostgresOpenTimeout.IsTimedOutByClock, a pure function. This covers both the web route andrun_custom_view_panel, which share the runner.Test plan
PostgresOpenTimeoutTests(no sockets, no sleeps): aborted-socket read at/near Timeout is timed out; at 50 ms is not; PostgresException at Timeout is not; caller cancellation at Timeout is not; anNpgsqlExceptionover a nestedOperationCanceledExceptionwith the caller live is timed out; the wrapper's flag drives the sentence.IsTimedOutByClock/FailedAfterTimeouttests do not compile on dev.AnAbortedSocketRead_IsNotATimeoutByShapeis a gap pin (it asserts false, so it passes on dev; it is not a runtime RED). The wrapper pinTheOpenHelper_ClocksTheOpen_AndFlagsALateFailure_AndTheSentenceReadsTheFlagis RED when any one ofStopwatch.StartNew(), theIsTimedOutByClock(call,{ FailedAfterTimeout = true }or|| open.FailedAfterTimeoutis deleted (each tried, each failed).PostgresOpenTimeoutTests23/0;ComposeClientTimeoutAttributionTests19/0;ComposeOpenPhaseTimeoutTests3/0;WebExceptionTextCensusTests40/0 (1 skip, live);DarlingComposeTests305/0.Follow-up to #5016
Round 1 fixes
OperationCanceledExceptionexclusion fromIsTimedOutByClock. A caller's cancellation is caught upstream andcallerCancelledcovers it, so a nested one with a live caller is the driver's ownTimeouttimer. The doc comment says so; new test added, and the cancelled-caller test kept.Timeoutis now read before the open, outside the catch, with anArgumentExceptionguard that turns the clock rule off.CHANGELOG entry
SECTION: Fixed
ENTRY: A custom view panel whose store accepts the connection but never answers now reports that the connection timed out, on the web route and in
run_custom_view_panel, instead of "could not open a store connection". (Folds into the #5016 entry.)