From 8be72d57567a4afe858ac4713efffdcc54a81972 Mon Sep 17 00:00:00 2001 From: kodumbeats Date: Fri, 12 Mar 2021 10:01:03 -0500 Subject: [PATCH] Sleep and assert only one execution --- tests/e2e/Services/Functions/FunctionsCustomClientTest.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/e2e/Services/Functions/FunctionsCustomClientTest.php b/tests/e2e/Services/Functions/FunctionsCustomClientTest.php index 0d71279bce..d759fc09fb 100644 --- a/tests/e2e/Services/Functions/FunctionsCustomClientTest.php +++ b/tests/e2e/Services/Functions/FunctionsCustomClientTest.php @@ -176,6 +176,7 @@ class FunctionsCustomClientTest extends Scope $this->assertEquals(201, $execution['headers']['status-code']); + sleep(10); $executions = $this->client->call(Client::METHOD_GET, '/functions/'.$functionId.'/executions', [ 'content-type' => 'application/json', 'x-appwrite-project' => $projectId, @@ -183,6 +184,7 @@ class FunctionsCustomClientTest extends Scope ]); $this->assertEquals(200, $executions['headers']['status-code']); + $this->assertCount(1, $executions['body']['executions']); $this->assertStringContainsString('foobar', $executions['body']['executions'][0]['stdout']); $this->assertStringContainsString($this->getUser()['$id'], $executions['body']['executions'][0]['stdout']);