fix: test: unit test flakes for activity logs stream#408
Open
JiwaniZakir wants to merge 1 commit intoslackapi:mainfrom
Open
fix: test: unit test flakes for activity logs stream#408JiwaniZakir wants to merge 1 commit intoslackapi:mainfrom
JiwaniZakir wants to merge 1 commit intoslackapi:mainfrom
Conversation
Replace time-based context cancellation with call-count-based cancellation using sync/atomic to eliminate race conditions between ticker intervals and sleep-based cancel goroutines. <svc-devxp-claude@slack-corp.com>
|
Thanks for the contribution! Before we can merge this, we need @JiwaniZakir to sign the Salesforce Inc. Contributor License Agreement. |
Member
|
👋 Hey @JiwaniZakir! This is an awesome PR to find! Super fast fix 🧪 ✨ Before we review it would it be possible to sight the CLA above? This will let us move forward with reviewing 🏛️ |
Author
|
Thanks @zimeg! I'll sign the CLA now — will update once complete. |
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.
Fixes #407
TestPlatformActivity_StreamingLogsininternal/pkg/platform/activity_test.gowas flaky because cancellation was driven bytime.Sleepgoroutines, making call count assertions race against wall-clock timing on slow CI runners. Replaces the sleep-based cancellation with call-count-driven cancellation usingsync/atomic.Int32counters inside the mock'sRuncallback, socancel()is called only after the expected number ofActivityinvocations. Verified by the deterministic call counts now asserted viacm.API.AssertNumberOfCalls.