Repository navigation
e2e: fix the Go watch-set loader reconnect flake - #919
Merged
Merged
Conversation
…ream TestE2EWatchSetLoaderRebuildsFromTruthOnReconnect failed most runs (7 of 10 locally, and in 11 of the 18 failed CI runs since 2026-09-24). Its priming loop stopped at the first ScriptMatched for its payment, which is usually the mempool match, and an unconfirmed match carries no cursor. The test then cut the transport, often before the confirmed match from the block payTo mines had reached the pump. The watch was left with no resume cursor, so the reconnect sent no SetCursor and the wait for CursorAccepted saw only heartbeats until its deadline. Every failing run had a nil ResumeCursor at the cut; every passing run had one. Wait for the confirmed match, as primeRW already does for the same reason. 30 of 30 local runs pass. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
bkeroack
added a commit
that referenced
this pull request
Oct 6, 2026
…ream (#919) TestE2EWatchSetLoaderRebuildsFromTruthOnReconnect failed most runs (7 of 10 locally, and in 11 of the 18 failed CI runs since 2026-09-24). Its priming loop stopped at the first ScriptMatched for its payment, which is usually the mempool match, and an unconfirmed match carries no cursor. The test then cut the transport, often before the confirmed match from the block payTo mines had reached the pump. The watch was left with no resume cursor, so the reconnect sent no SetCursor and the wait for CursorAccepted saw only heartbeats until its deadline. Every failing run had a nil ResumeCursor at the cut; every passing run had one. Wait for the confirmed match, as primeRW already does for the same reason. 30 of 30 local runs pass. Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com> (cherry picked from commit 9c7eb02)
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.
Fixes the Go e2e flake
TestE2EWatchSetLoaderRebuildsFromTruthOnReconnect, which fails withresilient watch Next (saw map[Heartbeat:180]): context deadline exceededatresilientwatch_test.go:249. It was in 11 of the 18 failedci.ymlruns from 2026-09-24 to today, on master pushes as well as PRs, and failed 7 of 10 runs locally. With a release-branch CI trigger coming (#913), it would turn mostrelease/0.6runs red for no reason.Cause
The test's bug, not the SDK's. The priming loop waits for the first
ScriptMatchedfor its payment, which is usually the mempool match. An unconfirmed match carries no cursor: the server sends none for a height-less match (watch_match_to_proto_sp_unconfirmed_has_no_cursorpins this). The test then cuts the transport. If the confirmed match from the block thatpayTomines has not reached the pump by then,ResilientWatchholds no resume cursor.connectOncesendsSetCursoronly when it has one, so noCursorAcceptedever comes, and the wait for it sees only heartbeats until the deadline.Logging
w.ResumeCursor()and the proxy's dial count at the cut, over six runs:nil{Height:141 MempoolSeq:144 …}The reconnect and the loader worked in every run; only the anchor was missing.
primeRW, used by the sibling test, already waits for the confirmed match, with a comment explaining this exact failure. This test kept the older loop.Fix
The priming loop also requires
m.Confirmed. The reload test has the same loop but never cuts the transport, so it needs no cursor and is unchanged.Verified
go test -tags e2e -count=10, then-count=20), against 3 of 10 before.go vet -tags e2eandclients/go/lint.share clean.Test-only, so no changelog entry. A forward-port to
masterfollows once this merges.🤖 Generated with Claude Code