-
Notifications
You must be signed in to change notification settings - Fork 146
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
Increase short 10 second timeout in TestFakeComponent #4101
Increase short 10 second timeout in TestFakeComponent #4101
Conversation
Pinging @elastic/elastic-agent (Team:Elastic-Agent) |
@@ -57,9 +57,6 @@ func TestFakeComponent(t *testing.T) { | |||
err = f.Prepare(ctx, fakeComponent, fakeShipper) | |||
require.NoError(t, err) | |||
|
|||
ctx, cancel = context.WithTimeout(context.Background(), 10*time.Second) |
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.
There is another context with timeout just above this one:
ctx, cancel := testcontext.WithDeadline(t, context.Background(), time.Now().Add(10*time.Minute))
defer cancel()
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.
Looks good.
buildkite test it |
Quality Gate passedKudos, no new issues were introduced! 0 New issues |
* Remove duplicated short timeout. * Log when statewatch starts. * Lower initial retry interval. (cherry picked from commit a79407e)
* Remove duplicated short timeout. * Log when statewatch starts. * Lower initial retry interval. (cherry picked from commit a79407e) Co-authored-by: Craig MacKenzie <[email protected]>
The TestFakeComponent test had a short 10 second context timeout, which is shorter than the retry interval of when waiting for the control socket. This is causing the test to continue to be flaky because it isn't allowing the control socket and agent enough time to start on Windows.
Fixes the failure below, where we start polling for the control socket at
2024-01-18T16:30:05.0297061
but the first agent logs have timestamp2024-01-18T16:30:13.362Z
8 seconds later.