Use usleep instead of select for timeouts in PostgresNode.pm
select() for pure timeouts is not portable, and in particular doesn't work on Windows. Discussion: https://postgr.es/m/186943e0-3405-978d-b19d-9d3335427c86@2ndQuadrant.com
This commit is contained in:
parent
09c2e7cd2f
commit
6c6970a280
@ -93,6 +93,7 @@ use RecursiveCopy;
|
|||||||
use Socket;
|
use Socket;
|
||||||
use Test::More;
|
use Test::More;
|
||||||
use TestLib ();
|
use TestLib ();
|
||||||
|
use Time::HiRes qw(usleep);
|
||||||
use Scalar::Util qw(blessed);
|
use Scalar::Util qw(blessed);
|
||||||
|
|
||||||
our @EXPORT = qw(
|
our @EXPORT = qw(
|
||||||
@ -1248,7 +1249,7 @@ sub poll_query_until
|
|||||||
}
|
}
|
||||||
|
|
||||||
# Wait 0.1 second before retrying.
|
# Wait 0.1 second before retrying.
|
||||||
select undef, undef, undef, 0.1;
|
usleep(100000);
|
||||||
|
|
||||||
$attempts++;
|
$attempts++;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user