runtests: assume Time::HiRes, drop Perl Win32 dependency

`Time::HiRes` was already used unconditionally before this patch in
`servers.pm`. This package, and functions used by runtests (`sleep` and
`gettimeofday`) are supported by the minimum Perl version required for
curl:

https://perldoc.perl.org/5.8.0/Time::HiRes

- Drop the `portable_sleep()` wrapper in favor of `Time::HiRes::sleep()`.
- Use `Time::HiRes` unconditionally in `serverhelp.pm`.
- Stop using the `Win32` package where available. It was included
  to provide a Windows fallback for `Time::HiRes::sleep()`. It was never
  actually called, but the dependency may have loaded `Win32.dll`, which
  often appears in failed fork operations in GHA logs.
  Ref: a6fed41f6f #5054 #5034
  Ref: https://github.com/curl/curl/discussions/14854

Closes #18287
This commit is contained in:
Viktor Szakats 2025-08-14 13:36:04 +02:00
parent c24d4be057
commit be01b60ce5
No known key found for this signature in database
GPG key ID: B5ABD165E2AEF201
6 changed files with 18 additions and 68 deletions

View file

@ -380,7 +380,7 @@ sub startnew {
logmsg "startnew: failed to write fake $pidfile with pid=$child\n";
}
# could/should do a while connect fails sleep a bit and loop
portable_sleep($timeout);
Time::HiRes::sleep($timeout);
if(checkdied($child)) {
logmsg "startnew: child process has failed to start\n" if($verbose);
return (-1,-1);