Merge pull request #9957 from appwrite/spr/1.7.x/336a4f07

tests: fix flaky messaging test
This commit is contained in:
Christy Jacob 2025-06-02 22:40:57 +04:00 committed by GitHub
commit d14eb3f12d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -206,15 +206,17 @@ class MessagingConsoleClientTest extends Scope
$this->assertEquals(200, $response['headers']['status-code']); $this->assertEquals(200, $response['headers']['status-code']);
$logs = $this->client->call(Client::METHOD_GET, '/messaging/topics/' . $topic['body']['$id'] . '/logs', \array_merge([ $this->assertEventually(function () use ($topic) {
'content-type' => 'application/json', $logs = $this->client->call(Client::METHOD_GET, '/messaging/topics/' . $topic['body']['$id'] . '/logs', \array_merge([
'x-appwrite-project' => $this->getProject()['$id'], 'content-type' => 'application/json',
], $this->getHeaders())); 'x-appwrite-project' => $this->getProject()['$id'],
], $this->getHeaders()));
$this->assertEquals($logs['headers']['status-code'], 200); $this->assertEquals($logs['headers']['status-code'], 200);
$this->assertIsArray($logs['body']['logs']); $this->assertIsArray($logs['body']['logs']);
$this->assertCount(2, $logs['body']['logs']); $this->assertCount(2, $logs['body']['logs']);
$this->assertIsNumeric($logs['body']['total']); $this->assertIsNumeric($logs['body']['total']);
});
$logs = $this->client->call(Client::METHOD_GET, '/messaging/topics/' . $topic['body']['$id'] . '/logs', \array_merge([ $logs = $this->client->call(Client::METHOD_GET, '/messaging/topics/' . $topic['body']['$id'] . '/logs', \array_merge([
'content-type' => 'application/json', 'content-type' => 'application/json',