Skip to content

Commit df5fd92

Browse files
committed
GODRIVER-3122 Fix prose test for index management.
1 parent 556e2f2 commit df5fd92

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

mongo/integration/search_index_prose_test.go

+4-3
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,10 @@ func TestSearchIndexProse(t *testing.T) {
212212
if !cursor.Next(ctx) {
213213
return nil
214214
}
215-
if cursor.Current.Lookup("queryable").Boolean() {
215+
name := cursor.Current.Lookup("name").StringValue()
216+
queryable := cursor.Current.Lookup("queryable").Boolean()
217+
status := cursor.Current.Lookup("status").StringValue()
218+
if name == searchName && queryable && status == "READY" {
216219
return cursor.Current
217220
}
218221
t.Logf("cursor: %s, sleep 5 seconds...", cursor.Current.String())
@@ -229,8 +232,6 @@ func TestSearchIndexProse(t *testing.T) {
229232
require.NoError(mt, err, "failed to drop index")
230233
doc = getDocument()
231234
require.NotNil(mt, doc, "got empty document")
232-
assert.Equal(mt, searchName, doc.Lookup("name").StringValue(), "unmatched name")
233-
assert.Equal(mt, "READY", doc.Lookup("status").StringValue(), "unexpected status")
234235
expected, err := bson.Marshal(definition)
235236
require.NoError(mt, err, "failed to marshal definition")
236237
actual := doc.Lookup("latestDefinition").Value

0 commit comments

Comments
 (0)