tests: add 60 seconds timeout for the API requests (#7905)

This commit is contained in:
Sawjan Gurung
2023-12-07 18:14:08 +05:45
committed by GitHub
parent 7acb1118be
commit 834982e2fb

View File

@@ -368,7 +368,7 @@ class HttpRequestHelper {
}
$options['stream'] = $stream;
$options['verify'] = false;
$options['timeout'] = $timeout;
$options['timeout'] = $timeout ?: self::getRequestTimeout();
return new Client($options);
}
@@ -677,4 +677,12 @@ class HttpRequestHelper {
}
return $parsedResponse;
}
/**
* @return int
*/
public static function getRequestTimeout(): int {
$timeout = \getenv("REQUEST_TIMEOUT");
return (int)$timeout ?: 60;
}
}