Tuning down log-level for spawn events to reduce mem. usage of default test config#211
Merged
sarsko merged 1 commit intoawslabs:mainfrom Sep 8, 2025
Merged
Conversation
Contributor
|
Its wild to me that this one change causes a 20x reduction in memory usage and a 25-ish% perf improvement. I am fine with the change, though I do like this event being INFO, as it is an important event. I’m wondering if the correct solution is to vend a better tracing subscriber (and our own test macro which installs it) |
sarsko
approved these changes
Sep 4, 2025
bkragl
approved these changes
Sep 4, 2025
This file contains hidden or 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
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.
The
test-logcrate usesINFOlevel logging by default. Thus anything at that level will be logged by default when running tests. The logs are also buffered in memory until the test has completed, which can lead to high memory consumption for tests producing verbose logs, in addition to increasing the test runtime.While logging has already been turned off by default in CI before this PR (
RUST_LOG=off), the default behavior with no additional environment variables causes the tests to run extremely slowly due to verbose logging. This is not a good experience for new developers of Shuttle and generally seems like a bad default.The primary culprit is logging task creation at
INFOlevel; we have several tests which do millions of shuttle iterations, each containing multiple task spawns. This PR moves that logging toDEBUG, so it is off by default during testing, but can be easily re-enabled by settingRUST_LOG=debug. With this change, running the shuttle test suite on my machine goes from:cargo test --release: from ~244s and >20 GB of RAM to ~183s and <1GB of RAMBy submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.