chore: added maxtimeout to testChannelExecutions

This commit is contained in:
Chirag Aggarwal
2025-03-03 14:34:10 +00:00
parent 32329ef3f9
commit c6b8e649fe
@@ -1311,6 +1311,8 @@ class RealtimeCustomClientTest extends Scope
$this->assertEquals($deployment['headers']['status-code'], 202);
$this->assertNotEmpty($deployment['body']['$id']);
$maxTimeSeconds = 10;
$startTime = time();
// Poll until deployment is built
while (true) {
$deployment = $this->client->call(Client::METHOD_GET, '/functions/' . $function['body']['$id'] . '/deployments/' . $deploymentId, [
@@ -1326,6 +1328,10 @@ class RealtimeCustomClientTest extends Scope
break;
}
if (time() - $startTime >= $maxTimeSeconds) {
throw new \Exception('Deployment timed out after ' . $maxTimeSeconds . ' seconds');
}
\sleep(1);
}