fix(observability): BuildUpdate one-shot guard — flip haveSentBuildUpdate [SDK-6574]#1133
Open
xxshubhamxx wants to merge 1 commit into
Open
fix(observability): BuildUpdate one-shot guard — flip haveSentBuildUpdate [SDK-6574]#1133xxshubhamxx wants to merge 1 commit into
xxshubhamxx wants to merge 1 commit into
Conversation
73945f9 to
1e08d42
Compare
…, not per test/hook [SDK-6574] The one-shot guard `if(!this.haveSentBuildUpdate && ...)` never flipped `haveSentBuildUpdate`, so the BuildUpdate event (a byte-identical, build-level `observability_version` payload) re-fired on every test/hook event — hundreds to thousands of identical events per build. Set the flag right after the event is sent so it is emitted once per reporter instance. Complements consumer-side dedupe TRAP-4033. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
1e08d42 to
5f782e8
Compare
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?
The Observability reporter is designed to send
BuildUpdateonce, but the one-shot guard never flipped its flag. Inbin/testObservability/reporter/index.js, the guard isif(!this.haveSentBuildUpdate && ...), butthis.haveSentBuildUpdatewas never set totrueafter the event was sent. So it stayedfalseandBuildUpdatere-fired on every test/hook event — hundreds to thousands of byte-identicalobservability_versionpayloads per build (≥10k observed for a single Cypress tenant in prod; 13/13 top BuildUpdate emitters are Cypress across SDK 1.31–1.36.x).The payload (
observability_version) is a build-level constant, so every re-emit is redundant. This floods the TRAevent_batch_top_v2Kafka partition (build-uuid-keyed → hot partition) and drives redundant testhub round-trips.Fix (additive, one line): set
this.haveSentBuildUpdate = trueimmediately after the BuildUpdate is sent.BuildUpdatenow fires once per reporter instance (≈ once per spec process); the byte-identical per-process emits are collapsed to one per build by the consumer-side dedupe in TRAP-4033.Change
await uploadEventData(buildUpdateData); + this.haveSentBuildUpdate = true; }Related Jira task/s
Testing
Single-line change; validated locally (no test file added to keep the PR minimal):
BuildUpdatewithout this line and exactly 1 with it.npm testsuite is unchanged at 678 passing / 13 failing (the 13 are pre-existing failures in unrelated modules — errorReporting / zipUpload / results-table / video-config).