alleyinteractive / alleyinteractive/elasticsearch-extensions

Replace `sleep()` with loop during index for VIP Search tests

オープン
#76 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る
elasticsearch enhancement php
主要言語
PHP
スター
5
フォーク
0
PR マージ指標
30日以内にマージされた PR はありません

説明

### Description

Currently, in order to create enough time for content to finish indexing for VIP Search tests, `sleep()` is used. This isn't the most time-effective manner of ensuring that the index is finished. Instead, we could write a loop with a set number of retries that queries for the posts in the index, and re-runs the loop up to N number of times until the item appears in the index. We [do something similar in SearchPress](https://github.com/alleyinteractive/searchpress/blob/main/tests/bootstrap.php#L29) which balances the need to wait for something to happen with the fact that it may not happen in the same amount of time all of the time and needing to put some kind of a sensible cap on it.

### Use Case

When indexing bootstrapped content in our tests, we should only wait as long as we need to for the indexing operation to finish before continuing to run the tests.

コントリビューションガイド

コントリビューションガイドを開く

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。