Sdk 6983 flush on signal - #104
Merged
Merged
Conversation
Signal-terminated runs previously lost their SDK-log tarball (onComplete's
upload never runs on a kill) and emitted no SDKTestSuccessful at all — the
funnelDataSent flag was set by SDKTestAttempted at startup, permanently
disarming the exit-time cleanup resend. Killed builds were undebuggable and
invisible to query-side kill detection.
- capture interrupt signals on BrowserStackConfig (killSignal)
- stamp finishedMetadata {reason: user_killed, signal} on SDKTestSuccessful
- exit-time cleanup rescues the logs.tar.gz upload (--uploadLogs), gated by
a logsUploaded flag so delivered uploads are never repeated
- mark funnelDataSent only for SDKTestSuccessful
- snapshot funnelData credentials before fireFunnelRequest redacts them
in place
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The kill reason previously rode only the analytics funnel; the TestHub
build-stop payload stayed empty on terminated runs. Propagate the caught
signal via env (the detached cleanup child has no in-memory config) and
stamp finished_metadata {reason: user_killed, signal} on the direct-flow
stopBuildUpstream PUT, and exitSignal/exitReason on the CLI StopBinSession
request (the binary maps them to finished_metadata).
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Reword the explanatory comments to remove the tracker-ID prefixes while keeping their content. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Add unit coverage for the interrupt-signal handling: the exit-handler uploadLogs rescue arg, the cleanup log-upload with pre-redaction creds, the funnel finish-reason/kill-signal marking, stopBuildUpstream's finished_metadata, and grpcClient's exitSignal/exitReason on stop. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…log uploads Signal listeners suppress Node's default termination, so a hung shutdown would live until CI's SIGKILL (which fires no 'exit' event, skipping the cleanup rescue). Arm an unref'd 5s grace timer that forces the conventional 128+n exit. Also stop marking logsUploaded when the upload server returns a non-success status, so a rejected upload stays eligible for the rescue. Merge the duplicate constants import. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
hamza-browserstack
requested review from
rounak610 and
xxshubhamxx
and removed request for
a team
July 27, 2026 17:32
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.
What is this about?
Related Jira task/s
Release (mandatory for every PR — required for the
ready-for-reviewlabel)Version bump: (required — tick exactly one)
Release notes type: (optional)
Release notes (customer-facing): (optional but encouraged)
Release notes (internal): (required — engineer-facing; what actually changed / why)
Checklist
PR Validations
Run Tests: Comment RUN_TESTS to trigger sanity tests.