Skip to content

fix: test: unit test flakes for activity logs stream#408

Open
JiwaniZakir wants to merge 1 commit intoslackapi:mainfrom
JiwaniZakir:fix/issue-407
Open

fix: test: unit test flakes for activity logs stream#408
JiwaniZakir wants to merge 1 commit intoslackapi:mainfrom
JiwaniZakir:fix/issue-407

Conversation

@JiwaniZakir
Copy link

Fixes #407

TestPlatformActivity_StreamingLogs in internal/pkg/platform/activity_test.go was flaky because cancellation was driven by time.Sleep goroutines, making call count assertions race against wall-clock timing on slow CI runners. Replaces the sleep-based cancellation with call-count-driven cancellation using sync/atomic.Int32 counters inside the mock's Run callback, so cancel() is called only after the expected number of Activity invocations. Verified by the deterministic call counts now asserted via cm.API.AssertNumberOfCalls.

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>
@JiwaniZakir JiwaniZakir requested a review from a team as a code owner March 17, 2026 13:55
@salesforce-cla salesforce-cla bot added the cla:missing The CLA was not signed label Mar 17, 2026
@salesforce-cla
Copy link

Thanks for the contribution! Before we can merge this, we need @JiwaniZakir to sign the Salesforce Inc. Contributor License Agreement.

@zimeg zimeg closed this Mar 17, 2026
@zimeg zimeg reopened this Mar 17, 2026
@zimeg
Copy link
Member

zimeg commented Mar 17, 2026

👋 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 🏛️

@JiwaniZakir
Copy link
Author

Thanks @zimeg! I'll sign the CLA now — will update once complete.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla:missing The CLA was not signed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

test: unit test flakes for activity logs stream

2 participants