Skip to content
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

runtests refactoring #10995

Closed
wants to merge 14 commits into from
Closed

runtests refactoring #10995

wants to merge 14 commits into from

Conversation

dfandrich
Copy link
Contributor

Most has to to with positioning for parallel testing, but a number of
test bugs discovered on the way are fixed as well.

Otherwise, an HTTP test closely following this one with a tight time
constraint (e.g. 672) could fail because the test server stays sitting
with the wait command for a while.
This will eventually need to be part of the test runner.

Ref: #10818
This speeds up tests by avoiding unnecessary processing.

Ref: #10818
This is code that is directly responsible for running a single test.
This will eventually run in a separate process as part of the parallel
testing project.

Ref: #10818
The tests for an older Valgrind version should probably just be deleted,
given that they're testing for an 18-year-old version.
testutil.pm now contains a few miscellaneous functions that are used in
several places but have no better place to live.  subvariables moves to
servers.pm since most variables that it substitutes relate to servers,
so this is the most appropriate place. Rename a few functions for better
naming consistency.

Ref: #10818
Closes #10995
This changed when the file was renamed in commit cbf5717
This reduces the startup time when there is a known conflict on the
random port chosen for a server.  This was already done for stunnel, but
now it's done for all servers.
If a server couldn't be started on a port, a new one is randomly chosen
and the server is tried again. Avoid accidentally using a
randomly-chosen 0 port offset by adding 1 to the random number.

Found-by: Daniel Stenberg
Calling stopserver() before retrying stunnel due to an error would stop
the dependent server (such as HTTP) meaning stunnel would have nothing
to talk to when it came up. Don't try to force a stop when it didn't
actually start.  Also, don't mark the server as bad for future use when
it starts up on a retry.

Fixes #10976
The verify time must be set in this case, like all cases. An error
message needs to be displayed as well.
tests/servers.pm Outdated Show resolved Hide resolved
The server ports are chosen randomly for each server, but the random
ranges chosen were inconsistently-sized and overlapping. Now, they are
spread out more so at least the first random port chosen for each server
is guaranteed to not also be chosen by another server. The starting port
numbers are also raised to put them in the Ephemeral Port range—not the
range defined by RFC 6335 but the one used by Linux, which starts lower
and gives us more room to work with.

Reported-by: Daniel Stenberg
@dfandrich dfandrich closed this in 707f74c Apr 18, 2023
@dfandrich dfandrich deleted the dfandrich/pr10995 branch April 18, 2023 20:20
bch pushed a commit to bch/curl that referenced this pull request Jul 19, 2023
testutil.pm now contains a few miscellaneous functions that are used in
several places but have no better place to live.  subvariables moves to
servers.pm since most variables that it substitutes relate to servers,
so this is the most appropriate place. Rename a few functions for better
naming consistency.

Ref: curl#10818
Closes curl#10995
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

Successfully merging this pull request may close these issues.

None yet

2 participants