Skip to content

Commit fdacdc5

Browse files
authored
Merge pull request #669 from meilisearch/bug/flaky-tests
Update phpunit migration & embedders test flaky test
2 parents 211fd30 + c144b96 commit fdacdc5

File tree

2 files changed

+19
-27
lines changed

2 files changed

+19
-27
lines changed

phpunit.xml.dist

Lines changed: 15 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,17 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3-
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.1/phpunit.xsd"
4-
bootstrap="vendor/autoload.php"
5-
convertErrorsToExceptions="true"
6-
convertNoticesToExceptions="true"
7-
convertWarningsToExceptions="true"
8-
stopOnFailure="false"
9-
cacheResult="false"
10-
colors="true">
11-
<testsuites>
12-
<testsuite name="Tests">
13-
<directory suffix="Test.php">./tests</directory>
14-
</testsuite>
15-
</testsuites>
16-
<coverage>
17-
<include>
18-
<directory>src/</directory>
19-
</include>
20-
</coverage>
21-
<php>
22-
<env name="MEILISEARCH_URL" value="http://localhost:7700"/>
23-
<env name="MEILISEARCH_API_KEY" value="masterKey"/>
24-
</php>
2+
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.5/phpunit.xsd" bootstrap="vendor/autoload.php" stopOnFailure="false" cacheResult="false" colors="true" cacheDirectory=".phpunit.cache">
3+
<testsuites>
4+
<testsuite name="Tests">
5+
<directory suffix="Test.php">./tests</directory>
6+
</testsuite>
7+
</testsuites>
8+
<php>
9+
<env name="MEILISEARCH_URL" value="http://localhost:7700"/>
10+
<env name="MEILISEARCH_API_KEY" value="masterKey"/>
11+
</php>
12+
<source>
13+
<include>
14+
<directory>src/</directory>
15+
</include>
16+
</source>
2517
</phpunit>

tests/Settings/EmbeddersTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public function testUpdateEmbeddersWithOpenAi(): void
3838
$promise = $index->updateEmbedders(['myEmbedder' => $embedderConfig]);
3939

4040
$this->assertIsValidPromise($promise);
41-
$index->waitForTask($promise['taskUid']);
41+
$index->waitForTask($promise['taskUid'], 10000);
4242

4343
$embedders = $index->getEmbedders();
4444
$embedderConfig['apiKey'] = '<yoXXXXX...';
@@ -58,7 +58,7 @@ public function testUpdateEmbeddersWithUserProvided(): void
5858
$promise = $index->updateEmbedders(['myEmbedder' => $embedderConfig]);
5959

6060
$this->assertIsValidPromise($promise);
61-
$index->waitForTask($promise['taskUid']);
61+
$index->waitForTask($promise['taskUid'], 10000);
6262

6363
$embedders = $index->getEmbedders();
6464

@@ -95,11 +95,11 @@ public function testResetEmbedders(): void
9595

9696
$promise = $index->updateEmbedders(['myEmbedder' => $embedderConfig]);
9797
$this->assertIsValidPromise($promise);
98-
$index->waitForTask($promise['taskUid']);
98+
$index->waitForTask($promise['taskUid'], 10000);
9999

100100
$promise = $index->resetEmbedders();
101101
$this->assertIsValidPromise($promise);
102-
$index->waitForTask($promise['taskUid']);
102+
$index->waitForTask($promise['taskUid'], 10000);
103103

104104
self::assertEmpty($index->getEmbedders());
105105
}

0 commit comments

Comments
 (0)