-
Notifications
You must be signed in to change notification settings - Fork 33
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
tests: improve readability of output #337
Conversation
I got another flake in
Not sure why the client would get a connection refused when |
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.
Thank you! This will be a nice improvement. My small comments aren't blocking if you want to ignore them.
it was a while back that rustls had a test suite that relied on opening and using lots of localhost ports, but back then macos was by far the most mysterious. i'm not sure if it lacks working network namespacing or what. eventually i got to an acceptable place by choosing a different random port for each test, and checking it was free (by attempting a TCP connection) before running the test on it. |
- Suppress output from run_with_maybe_valgrind until and unless there is an error. - If there is an error, print the environment along with the command. - In wait_tcp_port: - Don't print an error for the first connect. - Shorten the connect cycle times. - Make it clear that messages come from client-server.py
- simplify some of the repeated calls to `fprintf` - add a pid to each log line to make it easier to distinguish different invocations - print out relevant env variables on startup
And start using it in client.c.
8d9eb39
to
a8b085a
Compare
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.
LGTM. I threw up a branch to fix the new nightly clippy warnings that failed a couple CI tasks: #339
Following up on #336 I realized our test output is pretty hard to read.
In this PR I changed client-server.py so it suppresses
client
output. If theclient
command fails, it then prints the suppressed output along with the command line and environment. I'd like to also suppress theserver
output in the same way but that will require a bigger refactoring, since theserver
is currently started once and shared by multiple client runs. Most likely we'll wind up wanting to start one server and one client in each test case.I also added LOG and LOG_SIMPLE macros to client.c and server.c. This simplifies a lot of fprintf calls, and also allows us to print the pid with each log line, which will help tell apart separate server invocations in the logs.
The test
server
now prints its relevant environment variables at startup.