tests: try to make sleeping portable by avoiding select

select does not support just waiting on Windows:
https://perldoc.perl.org/perlport.html#select

Reviewed-By: Daniel Stenberg
Closes #5035
This commit is contained in:
Marc Hoersken 2020-03-04 11:44:49 +01:00
parent 1eecb0e022
commit 9aaca09044
No known key found for this signature in database
GPG key ID: 61E03CBED7BC859E
3 changed files with 37 additions and 8 deletions

View file

@ -493,7 +493,7 @@ sub sendcontrol {
for(@a) {
sockfilt $_;
select(undef, undef, undef, 0.01);
portable_sleep(0.01);
}
}
my $log;
@ -530,7 +530,7 @@ sub senddata {
# pause between each byte
for (split(//,$l)) {
sockfiltsecondary $_;
select(undef, undef, undef, 0.01);
portable_sleep(0.01);
}
}
}
@ -3199,7 +3199,7 @@ while(1) {
logmsg("Sleep for $delay seconds\n");
my $twentieths = $delay * 20;
while($twentieths--) {
select(undef, undef, undef, 0.05) unless($got_exit_signal);
portable_sleep(0.05) unless($got_exit_signal);
}
}