-
Notifications
You must be signed in to change notification settings - Fork 16
Fix throughput_stress resume #195
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
Conversation
| // each iteration. | ||
| UpdateWorkflowOptions func(context.Context, *Run, *KitchenSinkWorkflowOptions) error | ||
|
|
||
| DefaultConfiguration RunConfiguration |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Leftover from last PR where I removed it.
| } | ||
|
|
||
| // Initial check before entering the loop. | ||
| if err := check(); err != nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor optimization to query immediately instead of waiting for first tick.
| startTime := time.Now() | ||
| iterStart := time.Now() | ||
|
|
||
| defer func() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Main fix: by using defer, we now guarantee it always records the completion.
| go func() { | ||
| var err error | ||
| startTime := time.Now() | ||
| iterStart := time.Now() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Address variable shadowing.
9c9e0f4 to
6a689f5
Compare
6a689f5 to
be115a8
Compare
| }, | ||
| } | ||
| workerDone <- runner.Run(t.Context(), baseDir) | ||
| workerDone <- runner.Run(ctx, baseDir) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cancellation was never reaching worker ...
|
|
||
| env := workers.SetupTestEnvironment(t, | ||
| workers.WithExecutorTimeout(2*time.Minute), | ||
| workers.WithExecutorTimeout(1*time.Minute), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With proper worker shutdown (see below), test is much faster now.
What was changed
Fix resume bug.
Why?
The
OnCompletehook wasn't always invoked properly leading to under-counting the completed iterations.Checklist
Closes
How was this tested: