runtests.pl: Increase variance of random seed used for tests's port designation
authorSamuel Henrique <samueloph@debian.org>
Sun, 9 Mar 2025 10:41:25 +0000 (10:41 +0000)
committerSamuel Henrique <samueloph@debian.org>
Sat, 19 Jul 2025 19:04:59 +0000 (21:04 +0200)
 Patched on Debian to add day, hour and min to the seed, e.g.: 201912091530
 The version of curl we ship on bookworm is too prone to port conflicts on tests,
 this is the least intrusive workaround as it makes each retry use a different seed.

 Gbp-Pq: Name runtests_port_random_seed_variance.patch

Gbp-Pq: Name runtests.pl-Increase-variance-of-random-seed-used-for-tes.patch

tests/runtests.pl

index 7ac9de2dfe3c7cb42b90dea6e2e70769dac5f8de..398ac52f3afa89cb664dfd45973eefa6bc96960e 100755 (executable)
@@ -6031,7 +6031,10 @@ if(!$randseed) {
     my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) =
         localtime(time);
     # seed of the month. December 2019 becomes 201912
-    $randseed = ($year+1900)*100 + $mon+1;
+    # Patched on Debian to add day, hour and min to the seed: 201912091530
+    # The version of curl we ship on bookworm is too prone to port conflicts on tests,
+    # this is the least intrusive workaround as it makes each retry use a different seed.
+    $randseed = ($year+1900)*100 + $mon+1 + $mday + $hour + $min;
     open(C, "$CURL --version 2>/dev/null|");
     my @c = <C>;
     close(C);