feat: improve control of logs on test harness#26325
Merged
Conversation
hiltontj
added a commit
that referenced
this pull request
May 2, 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.
No issue for this. I was working on #26216 and decided to make this change.
This alters the logging behaviour and UX for the
TestServerharness that is used in our integration tests in theinfluxdb3crate.Changes
The primary change is the addition of a CLI argument for the
servecommand (--tcp-listener-file-path) that the server will use to write out the listener address that it is listening for TCP connections on.The argument is hidden and defaults to
None.This can be used by our test harness, which uses a bind address of
0.0.0.0:0in order to select a randomly available port.The test harness creates a temporary file and waits for it to be written to acquire the selected address of the underlying process.
Why this is an improvement
Previously, the
TestServerwas doing some weird business to capture the stdout of the running process and grab the log line that displays the listener address. This created a couple of issues:RUST_LOGenvironment variableUsage
The
TEST_LOGenvironment variable is still respected, and is required in order to have logs emitted by the underlyinginfluxdb3process.One can run tests like so:
This will have the underlying process emit logs at the
INFOlevel (and above). This is how it operated before this PR.Or, providing a filter:
This will pass the provided filter down to the underlying
influxdb3process (influxdb3=debug,info)The
RUST_LOGenfironment variable is also respected, soWill enable log output for the underlying
influxdb3process while passing the filter provided toRUST_LOGto the underlying process.