-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Deflake TestAgentForward #13166
Merged
Merged
Deflake TestAgentForward #13166
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Looks like this still doesn't quite solve it, I'm still seeing some flakiness. |
Joerger
approved these changes
Jun 3, 2022
r0mant
approved these changes
Jun 3, 2022
zmb3
force-pushed
the
zmb3/deflake-test-agent-forward
branch
from
June 6, 2022 21:30
447dff0
to
4390ecb
Compare
zmb3
force-pushed
the
zmb3/deflake-test-agent-forward
branch
from
June 6, 2022 21:32
4390ecb
to
7eb858c
Compare
Joerger
approved these changes
Jun 6, 2022
This was another case of the t.TempDir() being cleaned up while the audit logger is still writing to the directory, which happens when tests don't properly clean up after themselves. Ensure that any services we spin up closed via cleanup actions.
zmb3
force-pushed
the
zmb3/deflake-test-agent-forward
branch
2 times, most recently
from
June 7, 2022 00:37
53b0a17
to
0b8a770
Compare
zmb3
force-pushed
the
zmb3/deflake-test-agent-forward
branch
from
June 9, 2022 14:28
0b8a770
to
9ae3642
Compare
This fixes the flakiness, but I noticed a separate issue which I've filed here: #13335 |
xacrimon
approved these changes
Jun 9, 2022
The disk-based logger runs a background process to complete uploads, which occaisionally fails to finish before the test cleanup tries to remove the temporary directory. There are two ways to prevent the use of a disk based logger: 1. Set IsTestStub on the SSH *ServerContext 2. Use a sync session recording mode Option 2 was selected, because the ServerContext is created by the SSH server instead of the test, so plumbing that value through would be a larger change, and I generally dislike test specific modes that can be mistakenly enabled in non-test situations. Additionally, update the lib/srv/regular test fixture to allow for configuring the audit log to use. This allows us to set up a dicarding logger, since these tests are about agent forwarding behavior and not audit logging.
zmb3
force-pushed
the
zmb3/deflake-test-agent-forward
branch
from
June 9, 2022 15:43
29f0a6e
to
f9c7353
Compare
r0mant
approved these changes
Jun 9, 2022
zmb3
added a commit
that referenced
this pull request
Jun 9, 2022
* Attempt to deflake TestAgentForward This was another case of the t.TempDir() being cleaned up while the audit logger is still writing to the directory, which happens when tests don't properly clean up after themselves. Ensure that any services we spin up closed via cleanup actions. * Prevent the use of disk-based logging in TestAgentForward The disk-based logger runs a background process to complete uploads, which occaisionally fails to finish before the test cleanup tries to remove the temporary directory. There are two ways to prevent the use of a disk based logger: 1. Set IsTestStub on the SSH *ServerContext 2. Use a sync session recording mode Option 2 was selected, because the ServerContext is created by the SSH server instead of the test, so plumbing that value through would be a larger change, and I generally dislike test specific modes that can be mistakenly enabled in non-test situations. Additionally, update the lib/srv/regular test fixture to allow for configuring the audit log to use. This allows us to set up a dicarding logger, since these tests are about agent forwarding behavior and not audit logging.
zmb3
added a commit
that referenced
this pull request
Jun 9, 2022
* Attempt to deflake TestAgentForward This was another case of the t.TempDir() being cleaned up while the audit logger is still writing to the directory, which happens when tests don't properly clean up after themselves. Ensure that any services we spin up closed via cleanup actions. * Prevent the use of disk-based logging in TestAgentForward The disk-based logger runs a background process to complete uploads, which occaisionally fails to finish before the test cleanup tries to remove the temporary directory. There are two ways to prevent the use of a disk based logger: 1. Set IsTestStub on the SSH *ServerContext 2. Use a sync session recording mode Option 2 was selected, because the ServerContext is created by the SSH server instead of the test, so plumbing that value through would be a larger change, and I generally dislike test specific modes that can be mistakenly enabled in non-test situations. Additionally, update the lib/srv/regular test fixture to allow for configuring the audit log to use. This allows us to set up a dicarding logger, since these tests are about agent forwarding behavior and not audit logging.
zmb3
added a commit
that referenced
this pull request
Jun 10, 2022
* Deflake TestAgentForward (#13166) * Attempt to deflake TestAgentForward This was another case of the t.TempDir() being cleaned up while the audit logger is still writing to the directory, which happens when tests don't properly clean up after themselves. Ensure that any services we spin up closed via cleanup actions. * Prevent the use of disk-based logging in TestAgentForward The disk-based logger runs a background process to complete uploads, which occaisionally fails to finish before the test cleanup tries to remove the temporary directory. There are two ways to prevent the use of a disk based logger: 1. Set IsTestStub on the SSH *ServerContext 2. Use a sync session recording mode Option 2 was selected, because the ServerContext is created by the SSH server instead of the test, so plumbing that value through would be a larger change, and I generally dislike test specific modes that can be mistakenly enabled in non-test situations. Additionally, update the lib/srv/regular test fixture to allow for configuring the audit log to use. This allows us to set up a dicarding logger, since these tests are about agent forwarding behavior and not audit logging. * Fix failures Some tests are failing due to us now setting a clock on our auditlog. Get closer to the original behavior on this branch by: - not setting the clock - not using a checking emitter Co-authored-by: Zac Bergquist <zmb3@users.noreply.github.com>
zmb3
added a commit
that referenced
this pull request
Jun 13, 2022
* Attempt to deflake TestAgentForward This was another case of the t.TempDir() being cleaned up while the audit logger is still writing to the directory, which happens when tests don't properly clean up after themselves. Ensure that any services we spin up closed via cleanup actions. * Prevent the use of disk-based logging in TestAgentForward The disk-based logger runs a background process to complete uploads, which occaisionally fails to finish before the test cleanup tries to remove the temporary directory. There are two ways to prevent the use of a disk based logger: 1. Set IsTestStub on the SSH *ServerContext 2. Use a sync session recording mode Option 2 was selected, because the ServerContext is created by the SSH server instead of the test, so plumbing that value through would be a larger change, and I generally dislike test specific modes that can be mistakenly enabled in non-test situations. Additionally, update the lib/srv/regular test fixture to allow for configuring the audit log to use. This allows us to set up a dicarding logger, since these tests are about agent forwarding behavior and not audit logging.
zmb3
added a commit
that referenced
this pull request
Jun 13, 2022
* Attempt to deflake TestAgentForward This was another case of the t.TempDir() being cleaned up while the audit logger is still writing to the directory, which happens when tests don't properly clean up after themselves. Ensure that any services we spin up closed via cleanup actions. * Prevent the use of disk-based logging in TestAgentForward The disk-based logger runs a background process to complete uploads, which occaisionally fails to finish before the test cleanup tries to remove the temporary directory. There are two ways to prevent the use of a disk based logger: 1. Set IsTestStub on the SSH *ServerContext 2. Use a sync session recording mode Option 2 was selected, because the ServerContext is created by the SSH server instead of the test, so plumbing that value through would be a larger change, and I generally dislike test specific modes that can be mistakenly enabled in non-test situations. Additionally, update the lib/srv/regular test fixture to allow for configuring the audit log to use. This allows us to set up a dicarding logger, since these tests are about agent forwarding behavior and not audit logging. Co-authored-by: Zac Bergquist <zmb3@users.noreply.github.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This was another case of the t.TempDir() being cleaned up while the
audit logger is still writing to the directory, which happens when
tests don't properly clean up after themselves. Ensure that any
services we spin up closed via cleanup actions.
Updates #9492
Fixes #5333