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

Improve TUF test reliability and speed #1401

Merged
merged 6 commits into from
Oct 16, 2023

Conversation

RebeccaMahany
Copy link
Contributor

@RebeccaMahany RebeccaMahany commented Oct 13, 2023

I've noticed a lot of flaky errors with the TUF tests recently, and I think it's because they make heavier use of CopyBinary, which copies the test executable. (Example failure: https://github.com/kolide/launcher/actions/runs/6508335416/job/17677493575.) This PR tries out symlinking instead of copying to see if we experience fewer errors that way.

Also, the TUF tests are super slow. I determined this was because of the compression step -- locally, it takes 8 seconds per compression for me, but I suspect longer in the CI pipeline. Each usage of the TUF CI server (six separate instances) performs three compressions, so 18 compressions per test run. This PR embeds pre-compressed test binaries to significantly speed up the TUF tests.

Prior to this change, TUF autoupdater tests in the pipeline were taking an average of 209 seconds, or about 3.5 minutes (averaged over the most recent 5 CI jobs). In this PR, they took an average of just under 10 seconds.

@RebeccaMahany RebeccaMahany changed the title Symlink instead of copy binary to improve test reliability Improve TUF test reliability and speed Oct 13, 2023
@RebeccaMahany RebeccaMahany marked this pull request as ready for review October 13, 2023 15:02
directionless
directionless previously approved these changes Oct 13, 2023
Copy link
Contributor

@directionless directionless left a comment

Choose a reason for hiding this comment

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

Sure! Faster tests! 🚀

pkg/autoupdate/tuf/ci/tuf_server.go Outdated Show resolved Hide resolved
pkg/autoupdate/tuf/ci/tuf_server.go Outdated Show resolved Hide resolved
@RebeccaMahany RebeccaMahany added this pull request to the merge queue Oct 16, 2023
Merged via the queue into kolide:main with commit 12c0837 Oct 16, 2023
24 checks passed
@RebeccaMahany RebeccaMahany deleted the becca/tuf-test-binary branch October 16, 2023 13:46
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