mirror of
https://github.com/curl/curl.git
synced 2026-08-25 21:03:34 +03:00
runtests: use a per-runner random seed
Each runner needs a unique random seed to reduce the chance of port number collisions. The new scheme uses a consistent per-runner source of randomness which results in deterministic behaviour, as it did before. Ref: #10818
This commit is contained in:
parent
4317c5549b
commit
78d8bc4c63
3 changed files with 9 additions and 1 deletions
|
|
@ -168,6 +168,13 @@ sub runner_init {
|
|||
$ENV{'XDG_CONFIG_HOME'}=$ENV{'HOME'};
|
||||
$ENV{'COLUMNS'}=79; # screen width!
|
||||
|
||||
# Incorporate the $logdir into the random seed and re-seed the PRNG.
|
||||
# This gives each runner a unique yet consistent seed which provides
|
||||
# more unique port number selection in each runner, yet is deterministic
|
||||
# across runs.
|
||||
$randseed += unpack('%16C*', $logdir);
|
||||
srand $randseed;
|
||||
|
||||
# create pipes for communication with runner
|
||||
my ($thisrunnerr, $thiscontrollerw, $thiscontrollerr, $thisrunnerw);
|
||||
pipe $thisrunnerr, $thiscontrollerw;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue