Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Sleep within activity was too aggressive resulting in test flakiness #635

Merged

Conversation

samarabbas
Copy link
Contributor

What changed?
Increased sleep time in activity handler to 8 seconds to give more time for
activity to timeout.

Why?
ActivityHeartbeat test sets a 4 second timeout on the activity and
then gives it 5 seconds to timeout. This is pretty aggressive
specially on a slow machine where it might take server more than a
second to timeout activity due to heartbeat timeout. This resulted
in flakiness of this test.

How did you test it?

Potential risks

ActivityHeartbeat test sets a 4 second timeout on the activity and
then gives it 5 seconds to timeout.  This is pretty aggressive
specially on a slow machine where it might take server more than a
second to timeout activity due to heartbeat timeout.  This resulted
in flakiness of this test.
if err == nil {
s.Logger.Error("Activity expected to time out but got completed instead")
} else {
s.Logger.Info("Activity processing completed with error", tag.Error(err))
Copy link

@markmark206 markmark206 Jul 30, 2020

Choose a reason for hiding this comment

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

just thinking out loud, i wonder if it is easy / worth it to detect that the error is a timeout (which is expected), and, if so, make that clear in the log message that the failure is expected, something along the lines of

if err == nil {
    s.Logger.Error("omg this didn't timeout, unexpected!)
    // + maybe fail the test
} else if is_a_timeout(err) {
    s.Logger.Info("very legal very cool, timed out, as expected")
} else {
   s.Logger.Error("omg failed in unexpected ways!")
   // + fail the test
}

@samarabbas samarabbas merged commit 1908777 into temporalio:master Jul 31, 2020
@samarabbas samarabbas deleted the activity-heartbeat-flaky-test branch July 31, 2020 01:22
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.

2 participants