Skip to content

Conversation

@ctz
Copy link
Member

@ctz ctz commented Apr 22, 2025

The root cause here was the test runner choosing a port for the test servers to run on, but losing when that port was used by something else. Now the test server relies on the kernel to choose a free port.

fixes #37

ctz added 2 commits April 23, 2025 09:40
To make this work, have the test programs flush stdout before
abort.  stdout is block-buffered if it is a pipe.
Each case takes ~1s, so running them in series is quite slow.
This also increases the failure rate.
@ctz ctz force-pushed the jbp-server-algorithms-test branch from a571635 to 4875185 Compare April 23, 2025 10:20
@ctz ctz marked this pull request as ready for review April 23, 2025 10:33
@ctz ctz requested a review from djc April 23, 2025 10:54
Copy link
Member

@cpu cpu left a comment

Choose a reason for hiding this comment

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

The root cause here was the test runner choosing a port for the test servers to run on, but losing when that port was used by something else.

Ahhh yup, that'll do it 🤦‍♂️ Thanks for catching that.

tests/runner.rs Outdated
.args([
"-v",
"--header",
"Host: localhost:port",
Copy link
Member

Choose a reason for hiding this comment

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

What does this do? Seems surprising to have port literally here?

Copy link
Member Author

Choose a reason for hiding this comment

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

Removed the :port for clarity. Because tests/server.c dumps all the data it receives from curl, and because we check its output matches (whether run against openssl or rustls libssl), we need the data sent by curl to be determinstic. This commit stopped that being true, because the server port now varies between runs.

Formerly, the test runner chose a port for each server invocation,
but this wasn't robust if the port it chose was already in use.
Now the test runner asks for port zero, which means the kernel
chooses an ephemeral port that is free.  The server then prints
the port it is listening on, and the runner parses that out.

Remove the now-variable port sent by curl in the `Host:` header.
@ctz ctz force-pushed the jbp-server-algorithms-test branch from 4875185 to 1bdf3e1 Compare April 23, 2025 16:24
@ctz ctz merged commit 2bd181a into main Apr 23, 2025
32 checks passed
@ctz ctz deleted the jbp-server-algorithms-test branch April 23, 2025 16:30
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.

server_key_algorithms test flaky?

4 participants