Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Fix task parallel processor test #2951

Merged
merged 1 commit into from
Jun 4, 2022

Conversation

yycptt
Copy link
Member

@yycptt yycptt commented Jun 4, 2022

What changed?

  • Fix flaky test TestSubmitProcess_Stopped_FailSubmission

Why?

  • There's no guarantee that calling Submit() after Stop() will make the task get rescheduled immediately since worker goroutine shutdown is async. It's possible that a worker didn't get the shutdown notification immediately after Stop() is called and picks up the submitted task from task channel.
  • Recent changes to parallel processor makes worker goroutine shutdown slightly slower than before (shutdown notification is propagated via another worker monitor goroutine). and makes ^ race condition in test visible.

How did you test it?

go test -run TestParallelProcessorSuite -testify.m TestSubmitProcess_Stopped_Submission -count=10000 -v

Potential risks

Is hotfix candidate?

@yycptt yycptt requested review from wxing1292 and yiminc June 4, 2022 18:26
@yycptt yycptt requested a review from a team as a code owner June 4, 2022 18:26
@yycptt yycptt enabled auto-merge (squash) June 4, 2022 18:42
@yycptt yycptt merged commit 732d43a into temporalio:master Jun 4, 2022
@yycptt yycptt deleted the fix-parallel-processor-test branch June 4, 2022 19:30
Sushisource pushed a commit to Sushisource/temporal that referenced this pull request Jun 7, 2022
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants