Repository navigation
fix(logservice): make fallback test deterministic - #28406
Conversation
Qodo reviews are paused for this user.Troubleshooting steps vary by plan Learn more → On a Teams plan? Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center? |
XuPeng-SH
left a comment
There was a problem hiding this comment.
Reviewed exact head b67c140 against base 585a38e, including every changed hunk, the full test/helper and connectToLogServiceAddresses attempt/result/close paths. No confirmed blocker found.
The fix addresses both independent failure mechanisms in #28381 without weakening the successful-loser oracle. ElementsMatch correctly checks that both addresses were attempted without assuming goroutine callback arrival order. After the release barrier is closed, the nested check makes both mocks return success even if winner cancellation wins the first select. The assertions still require exactly one loser close before explicitly closing the winner, and two closes afterward.
Failure-path ownership is now ordered: releaseOnce makes normal/cleanup release idempotent; the cleanup defer releases and cancels, joins finished, and only then the earlier defer restores the global function/delay. The connection function itself joins all launched attempts before return, so finished covers those hook readers. Both called entries fit their channel; the single result/error fits its buffered output; mock Close only takes the short local counter mutex. No package test uses t.Parallel, and no other test writes this hook. There is no new production behavior, wire/storage contract or runtime cost.
The two-second cleanup timer is diagnostic, not a claim that teardown has a hard bound: the following join deliberately prevents restoring a global hook while work survives. The concrete released/cancelled two-attempt mock chain terminates; I found no reachable new wait cycle in this fixture. The existing one-millisecond fallback timer exercises the actual fallback path, while the correctness assertions use events rather than a sleep-based completion guess.
Evidence: current-head CI run 34202485757 is green, including Ubuntu UT and the executed integration lanes. I used source/CI evidence, not a new local repeated native race run. A focused repeated race run with both callback arrival orders and an early-failure cleanup arm would be useful additional regression evidence, but absence of that extra run is not a verified source blocker.
Merge Queue Status
This pull request spent 1 minute 44 seconds in the queue, with no time running CI. Waiting for
All conditions
ReasonPull request #28406 has been dequeued Pull request from fork cannot be queued. This pull request comes from a fork, and Mergify needs the author's permission to update its branch.
HintYou should look at the reason for the failure and decide if the pull request needs to be fixed or if you want to requeue it. Tick the box to put this pull request back in the merge queue (same as
|
Fixes matrixorigin#28381 ## What type of PR is this? - [ ] API-change - [ ] BUG - [ ] Improvement - [ ] Documentation - [ ] Feature - [ ] Test and CI - [ ] Code Refactoring ## Which issue(s) this PR fixes: issue matrixorigin#28381 ## What this PR does / why we need it: fix(logservice): make fallback test deterministic Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Fixes matrixorigin#28381 ## What type of PR is this? - [ ] API-change - [ ] BUG - [ ] Improvement - [ ] Documentation - [ ] Feature - [ ] Test and CI - [ ] Code Refactoring ## Which issue(s) this PR fixes: issue matrixorigin#28381 ## What this PR does / why we need it: fix(logservice): make fallback test deterministic Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Fixes matrixorigin#28381 ## What type of PR is this? - [ ] API-change - [ ] BUG - [ ] Improvement - [ ] Documentation - [ ] Feature - [ ] Test and CI - [ ] Code Refactoring ## Which issue(s) this PR fixes: issue matrixorigin#28381 ## What this PR does / why we need it: fix(logservice): make fallback test deterministic Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Fixes #28381
What type of PR is this?
Which issue(s) this PR fixes:
issue #28381
What this PR does / why we need it:
fix(logservice): make fallback test deterministic