Skip to content

Commit ab289d8

Browse files
committed
test(search): improve test stability
1 parent ecf59ae commit ab289d8

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

runtime/runtime_http_search_test.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,11 @@ func TestIndex_Http(t *testing.T) {
6464
test: func(t *testing.T, app *runtime.App) {
6565
cfg := openapitest.NewConfig("3.0", openapitest.WithInfo("foo", "", ""))
6666
app.AddHttp(toConfig(cfg))
67+
waitSearchIndex(t, func() bool {
68+
r, err := app.Search(search.Request{QueryText: "foo", Limit: 10})
69+
require.NoError(t, err)
70+
return len(r.Results) == 1
71+
})
6772
r, err := app.Search(search.Request{QueryText: "foo", Limit: 10})
6873
require.NoError(t, err)
6974
require.Len(t, r.Results, 1)

0 commit comments

Comments
 (0)