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

Include logs in test failure when TUF autoupdater doesn't shut down/restart within 5 seconds #1452

Merged

Conversation

RebeccaMahany
Copy link
Contributor

I've seen this test failure fairly frequently: https://github.com/kolide/launcher/actions/runs/6852148852/job/18630008978

Not sure why it's happening -- it doesn't happen locally -- so I'm including the autoupdater logs in the test failure message in order to figure it out.

@@ -116,7 +116,7 @@ func TestExecute_launcherUpdate(t *testing.T) {
shutdownDeadline := time.Now().Add(5 * time.Second).Unix()
for {
if time.Now().Unix() > shutdownDeadline {
t.Error("autoupdater did not shut down within 5 seconds")
t.Error("autoupdater did not shut down within 5 seconds -- logs: ", logBytes.String())
Copy link
Contributor

Choose a reason for hiding this comment

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

I wonder if this is going to be readable, or kind of a mess. I wonder about just copying it to os.Stderr

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It'll definitely be a little messy, but it's hopefully not permanent! I don't think we'd see output if we copy to os.Stderr -- I find that output from tests tends to get swallowed in CI, and if I write something to os.Stderr in a test I don't see that output when running make test locally.

@RebeccaMahany RebeccaMahany added this pull request to the merge queue Nov 13, 2023
Merged via the queue into kolide:main with commit 2e12bc0 Nov 13, 2023
25 checks passed
@RebeccaMahany RebeccaMahany deleted the becca/tuf-autoupdater-shutdown-tests branch November 13, 2023 17:25
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