Skip to content

Instrument flaky test: TestWorkflowTaskAndActivityTaskTimeoutsWorkflow - #9137

Merged
dandavison merged 9 commits into
temporalio:mainfrom
dandavison:fix-flaky-task-timeouts-test
Jan 26, 2026
Merged

dandavison merged 9 commits into
temporalio:mainfrom
dandavison:fix-flaky-task-timeouts-test

Conversation

@dandavison

@dandavison dandavison commented Jan 26, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Add logging to test with the aim of helping diagnosis next time it times out

Tested by:

go test -v -count 1 -tags test_dep go.temporal.io/server/tests -run='WorkflowTestSuite/TestWorkflowTaskAndActivityTaskTimeoutsWorkflow'

Note

Instruments the flaky TestWorkflowTaskAndActivityTaskTimeoutsWorkflow with detailed info-level logging to help diagnose intermittent 35m timeouts.

  • Adds testTag, iteration timers, and last-drop tracking; logs iteration starts, task drops/processing (with expected attempt), activity polling durations, and errors
  • Prints compact history on errors and logs final wait for workflow completion
  • Test-only changes; no production behavior modified

Written by Cursor Bugbot for commit a55a2e7. This will update automatically on new commits. Configure here.

Attempting to reproduce TestWorkflowTaskAndActivityTaskTimeoutsWorkflow
timing out after 35m in CI.
@dandavison
dandavison force-pushed the fix-flaky-task-timeouts-test branch from 36def4b to 93a277e Compare January 26, 2026 14:05
Log timing and attempt count info to understand what happens when
TestWorkflowTaskAndActivityTaskTimeoutsWorkflow times out in CI.
SQLite functional tests don't need external services. The previous
workflow failed because all 20 parallel jobs tried to bind port 9200.
The Makefile defaults to nosql/cassandra. Need both env vars.
Running full WorkflowTestSuite (15 parallel tests) with CPU stress
to simulate CI load conditions that may cause 1-second timeouts to
misfire.
Run multiple timing-sensitive suites (WorkflowTestSuite,
TransientTaskTestSuite, StickyTQTestSuite) with heavy CPU+IO+VM
stress to reproduce flakiness.
Constrain to single OS thread to expose timing bugs where goroutines
don't get scheduled promptly during the 1-second timeout windows.
Add timing instrumentation to TestWorkflowTaskAndActivityTaskTimeoutsWorkflow
to help diagnose what happens when the test times out in CI. All log lines
are prefixed with the test name to distinguish them from other concurrent
tests.

Reverts taskpoller.go changes to avoid affecting other tests.
@dandavison
dandavison force-pushed the fix-flaky-task-timeouts-test branch from 741dbce to a55a2e7 Compare January 26, 2026 17:21
@dandavison dandavison changed the title Fix TestWorkflowTaskAndActivityTaskTimeoutsWorkflow test timed out after 35m0s Instrument flaky test: TestWorkflowTaskAndActivityTaskTimeoutsWorkflow Jan 26, 2026
Comment thread tests/workflow_test.go
@@ -1289,14 +1289,34 @@ func (s *WorkflowTestSuite) TestWorkflowTaskAndActivityTaskTimeoutsWorkflow() {
T: s.T(),
}

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The lines below are the only change in this PR. They are intended to

  • provide helpful information for debugging next time this occurs
  • be prefixed apropriately so it is clear to what test they refer to

My intention is that this change will be reverted when we fix the flakiness.

@dandavison
dandavison marked this pull request as ready for review January 26, 2026 17:30
@dandavison
dandavison requested review from a team as code owners January 26, 2026 17:30
@dandavison
dandavison enabled auto-merge (squash) January 26, 2026 17:35
@dandavison
dandavison merged commit 643e6d4 into temporalio:main Jan 26, 2026
112 of 115 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.

3 participants