elastic / app-search-php

Elastic App Search Official PHP Client
https://www.elastic.co/products/app-search
Apache License 2.0
51 stars 21 forks source link

Flaky document test in PHP client CI integration #41

Closed richkuz closed 4 years ago

richkuz commented 4 years ago

One time, I observed a failure in the PHP CI test, DocumentApiTest::testDeleteDocuments(). sleeping for 1 second isn't consistently long enough.

It's possible that similar flaky results could occur in other tests in this class that rely on sleep.

We could increase the sleep time from 1 to 10, for example.

Or, we could write the tests in a way that poll for n seconds (e.g. 10) until the expected condition is met.