-
Notifications
You must be signed in to change notification settings - Fork 2k
Add integration test for Firecracker with clippy-tracing instrumentation #5256
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
base: main
Are you sure you want to change the base?
Add integration test for Firecracker with clippy-tracing instrumentation #5256
Conversation
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.
@demoncoder-crypto thanks for your contribution!
I added some inline comments. Apart from that, could you please make changes to the commit message:
- add the
test:
scope tag at the beginning of its title - add a (small) paragraph with a more detailed description of the commit
- add the Signed-off-by line (can be generated via
git commit -s
)
I also triggered a CI build to see if tests pass.
def test_firecracker_tracing_with_vm_lifecycle(instrumented_firecracker_binary): | ||
"""Test that instrumented Firecracker works through a complete VM lifecycle with tracing.""" | ||
# Skip this test if we don't have the necessary resources | ||
if not global_props.host_linux_version_tup >= (4, 14): |
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 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.
understood
assert found_meaningful, f"Expected to find traces from meaningful functions, but traces were: {trace_matches[:10]}" | ||
|
||
|
||
def test_firecracker_tracing_with_vm_lifecycle(instrumented_firecracker_binary): |
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.
this test looks a bit like a subset of the test_firecracker_tracing_basic_functionality
. What do you think it adds to that one?
|
||
# Should complete within reasonable time (30 seconds is very generous) | ||
# This is just to catch major performance regressions or hangs | ||
assert elapsed < 30, f"Instrumented Firecracker took too long to start and handle API calls: {elapsed}s" |
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.
this looks like a good idea
|
||
# The new log data should contain trace information | ||
new_log_data = final_log_data[len(initial_log_data):] | ||
assert "TRACE" in new_log_data, "Expected TRACE logs after setting log level to Trace" |
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.
shall we also verify that no TRACE
is present in the initial_log_data
?
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.
Done
@@ -0,0 +1,305 @@ | |||
# Copyright 2024 Amazon.com, Inc. or its affiliates. All Rights Reserved. |
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.
it is 2025 now
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.
LLM error
|
||
"""Test that Firecracker works correctly when instrumented with tracing and trace level logs are enabled. | ||
|
||
This test addresses GitHub issue about adding a test that checks if simple integration tests work |
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.
I don't think we should refer to a Github issue here. It should be possible to trace it back via commit -> PR -> GH issue.
This test addresses GitHub issue about adding a test that checks if simple integration tests work | ||
when Firecracker is instrumented with src/clippy-tracing and trace level logs are enabled. | ||
|
||
The existing test_log_instrument.py only tests the log-instrument crate with example programs. |
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.
We can probably omit this paragraph as well as comments should describe the present state (when the PR is already merged).
0595ad0
to
b8bf90e
Compare
@kalyazin I have pushed the changes as requested |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #5256 +/- ##
==========================================
+ Coverage 82.84% 82.90% +0.05%
==========================================
Files 250 250
Lines 26967 26967
==========================================
+ Hits 22342 22356 +14
+ Misses 4625 4611 -14
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Verifies Firecracker works with clippy-tracing instrumentation and trace-level logging enabled. Signed-off-by: demoncoder-crypto <dhillonprabhjitsingh@gmail.com>
b8bf90e
to
ac6cfa0
Compare
I ran the CI checks, it looks like there is a minor style issue and and a problem with calling
https://buildkite.com/firecracker/firecracker-pr/builds/13695#_ You should be able to run the tests locally via the |
Addresses Test instrumented binary #4215