Skip to content

Commit

Permalink
Give more time on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
iamluc committed Sep 13, 2024
1 parent 87a8d4e commit 847d7dd
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions tests/ext/includes/request_replayer.inc
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ class RequestReplayer
*/
private $flushInterval;

/**
* @var int
*/
private $maxIteration;

public function __construct()
{
$this->endpoint = sprintf(
Expand All @@ -23,6 +28,8 @@ class RequestReplayer
$this->flushInterval = getenv('DD_TRACE_AGENT_FLUSH_INTERVAL')
? (int) getenv('DD_TRACE_AGENT_FLUSH_INTERVAL') * 100
: 50000;

$this->maxIteration = (strncasecmp(PHP_OS, "WIN", 3) === 0) ? 500 : 100;
}

public function waitForFlush()
Expand All @@ -34,7 +41,7 @@ class RequestReplayer
{
$i = 0;
do {
if ($i++ == 100) {
if ($i++ == $this->maxIteration) {
throw new Exception("wait for replay timeout");
}
usleep($this->flushInterval);
Expand All @@ -54,7 +61,7 @@ class RequestReplayer
{
$i = 0;
do {
if ($i++ == 100) {
if ($i++ == $this->maxIteration) {
throw new Exception("wait for replay timeout");
}
usleep($this->flushInterval);
Expand Down

0 comments on commit 847d7dd

Please sign in to comment.