test(morpc): stabilize slow backend creation test - #28673
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.
APPROVE at 543df36 against base cd8e8d9. No concrete blocker found.
The change replaces scheduler-sensitive 50ms/150ms expectations with an actual blocked-factory phase. It asserts ErrBackendCreating and nil results, observes the exact creation state under c.mu, proves a second lookup returns while the factory is still blocked, then releases the factory and waits for that creation's completion before checking availability. The final successful lookup is important: done is a terminal notification and can also close on failure/invalidation, so waiting alone would not prove publication.
Cleanup releases the factory once before synchronous client Close, including FailNow paths after cleanup registration. The lookup result channel is buffered, so a timeout does not strand its sender waiting on the test. The existing creation coalescing rule admits one factory call per remote generation; no sleep, retry, swallowed error, socket, port or global configuration is added. The test continues exercising production asynchronous creation and lookup locking, without weakening the intended non-blocking property into a timing assumption.
Non-blocking: the initial getBackend call remains synchronous in the test, so a regression that blocks that very first call relies on the package timeout rather than the later 5-second guards. Making that initial call bounded would improve failure diagnostics, but does not create a false pass or regress the current implementation.
Evidence: full one-file diff and exact-head factory, getBackend/admission, creation-terminal and Close ownership source review. Author reports focused repeated/race and package runs; I did not rerun native tests or wait for CI. No production code changes. Head/base were rechecked unchanged during final validation.
Merge Queue Status
This pull request spent 6 minutes 48 seconds in the queue, with no time running CI. Waiting for any of
All conditions
ReasonPull request #28673 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
|
What type of PR is this?
Which issue(s) this PR fixes:
issue #28532
What this PR does / why we need it:
TestGetBackendWithSlowConnectionwith explicit factory phase barriers.getBackendreturnsErrBackendCreatingwhile factory I/O is blocked.Testing
.agents/skills/mo-dev/scripts/mo-cgo-test -v -count=1 -timeout=120s -run '^TestGetBackendWithSlowConnection$' ./pkg/common/morpc.agents/skills/mo-dev/scripts/mo-cgo-test -count=100 -timeout=120s -run '^TestGetBackendWithSlowConnection$' ./pkg/common/morpc.agents/skills/mo-dev/scripts/mo-cgo-test -race -count=100 -timeout=240s -run '^TestGetBackendWithSlowConnection$' ./pkg/common/morpc.agents/skills/mo-dev/scripts/mo-cgo-test -count=1 -timeout=300s ./pkg/common/morpc.agents/skills/mo-dev/scripts/mo-cgo-test -race -count=1 -timeout=600s ./pkg/common/morpc