Skip to content

Fix/sdk 7265 wdio deferred test finish flush - #146

Merged
rahulpsq merged 7 commits into
sdk_v9_pre_prod_14augfrom
fix/sdk-7265-wdio-deferred-test-finish-flush
Aug 14, 2026
Merged

Fix/sdk 7265 wdio deferred test finish flush#146
rahulpsq merged 7 commits into
sdk_v9_pre_prod_14augfrom
fix/sdk-7265-wdio-deferred-test-finish-flush

Conversation

@rahulpsq

Copy link
Copy Markdown
Contributor

What is this about?

Related Jira task/s

Release (mandatory for every PR — required for the ready-for-review label)

Version bump: (required — tick exactly one)

  • minor (backwards-compatible feature)
  • patch (bug fix or other small change)

Release notes type: (optional)

  • New Feature
  • Bug Fix
  • Other Improvement

Release notes (customer-facing): (optional but encouraged)

Release notes (internal): (required — engineer-facing; what actually changed / why)

Checklist

  • Ready to review
  • Has it been tested locally?

PR Validations

Run Tests: Comment RUN_TESTS to trigger sanity tests.

rounak610 and others added 7 commits August 12, 2026 13:17
…ed (SDK-7265)

The binary flow defers each mocha TestRunFinished past the afterEach window and
flushes it at the next test's boundary; the worker's last test relies on the
single flush from service.after(). sendTestFrameworkEvent swallowed send errors
with no retry, so a transient gRPC failure on that flush dropped the finish —
orphaning one test that Test Hub reaps at its ~60-min per-test timeout, which
stamps the whole (passing) build `timeout`.

Retry the flush up to 3x with backoff, surface send success/failure, and
re-stash on total failure so a later flush/teardown can retry rather than
dropping it. Mirrors SDK-7061's build-stop retry, applied to the test-finish
path. Adds a deterministic reproduction test.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…then tests (SDK-7265)

Review found the re-stash-on-exhaustion guard races the two fire-and-forget
flushPendingTestFinishEvent call sites: because the retry loop keeps an
invocation in flight, a newer test can take the single pendingTestFinish slot
while an older invocation is still retrying, and on exhaustion the guard either
re-stashes a stale, already-failed event or drops silently — reintroducing the
SDK-7265 symptom under a narrower window.

Remove the re-stash entirely (it gave no reliable benefit: nothing re-flushes
after service.after(), the last-test path). args is captured locally and the
shared slot is only cleared, never written back, so concurrent flushes each
retry their own event without clobbering one another.

Tests: assert every retry re-sends the same finish (not just call count); drive
the retry budget to full exhaustion and assert no re-stash; add a concurrency
guard proving an older retrying flush never drops a newer test's finish.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…e chain)

No behavior change — same retry-with-backoff and exhaustion handling, expressed
as a recursive promise chain instead of an async/await loop, restoring the
original Promise<void> | undefined signature. sendTestFrameworkEvent keeps its
boolean-success return (so the un-awaited caller at line 130 is unaffected).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…earing why

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@rahulpsq
rahulpsq requested a review from a team as a code owner August 14, 2026 12:32
@rahulpsq
rahulpsq requested review from osho-20 and pranay-v29 and removed request for a team August 14, 2026 12:32
@rahulpsq
rahulpsq merged commit 6e1fa72 into sdk_v9_pre_prod_14aug Aug 14, 2026
26 of 30 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants