You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Flaky recovery daemon readiness in recoveryhost tests #2916
TestServerProviderRecovery_Scenario7_HostLogDeliveryPolicy/operational_sink in cmd/mecated failed in the Test (race) job on PR #2899 (run 44744264080) with recoveryhost.go:208: daemon did not become ready, then passed on a re-run with no code change. The PR touched nothing under cmd/mecated or internal/app, and the test passed 3 of 3 locally with -race.
recoveryhost.Daemon (internal/testutil/recoveryhost/recoveryhost.go) has two fragile spots:
Startup budget. The child daemon, a race-instrumented re-exec of the test binary, gets a fixed 10-second context to accept POST /v1/sessions. On a loaded CI runner that budget can run out before the daemon finishes starting.
Port pre-pick. The test listens on 127.0.0.1:0, closes the listener, and passes the address to the daemon as --http-addr. Another process can take the port in between, and the daemon then fails to bind.
The failure also hides the cause: the child's stdout and stderr are buffered and never printed, so a bind error and a slow start look the same.
cmd/mecak8s/recovery_log_policy_test.go uses the same helper, so it shares the risk.
Acceptance criteria
The daemon binds a port it reports back (for example --http-addr=127.0.0.1:0 plus a readiness line or file), or the test otherwise no longer pre-picks a port it then releases.
The readiness wait tolerates a slow race-built start, or waits on an explicit readiness signal instead of a fixed deadline.
On a readiness failure, the test prints the child's stderr tail.
task lint && task test:race pass, and nothing under engine/ changes.
I'd like to work on the recoveryhost readiness test. I'll separate a slow daemon becoming ready from a genuinely occupied port and verify the recovery path without relying on a fixed startup sleep. Could you assign this if available?
Activity
ningsiyuan1024 commentedon Nov 25, 2026
I'd like to work on the recoveryhost readiness test. I'll separate a slow daemon becoming ready from a genuinely occupied port and verify the recovery path without relying on a fixed startup sleep. Could you assign this if available?