Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Just look for fields not found previously
  • Loading branch information
mrodm committed Feb 25, 2025
commit 16753675ae2610b94c35adc64e85f8eff82418c6
5 changes: 5 additions & 0 deletions internal/testrunner/runners/system/tester.go
Original file line number Diff line number Diff line change
Expand Up @@ -1547,6 +1547,7 @@ func (r *tester) waitForDocs(ctx context.Context, config *testConfig, dataStream
var hits *hits
oldHits := 0
prevTime := time.Now()
foundFields := map[string]any{}
passed, waitErr := wait.UntilTrue(ctx, func(ctx context.Context) (bool, error) {
var err error
hits, err = r.getDocs(ctx, dataStream)
Expand Down Expand Up @@ -1616,6 +1617,9 @@ func (r *tester) waitForDocs(ctx context.Context, config *testConfig, dataStream
return false
}
for _, f := range config.Assert.FieldsPresent {
if _, found := foundFields[f]; found {
continue
}
found := false
for _, d := range hits.Fields {
if _, err := d.GetValue(f); err == nil {
Expand All @@ -1628,6 +1632,7 @@ func (r *tester) waitForDocs(ctx context.Context, config *testConfig, dataStream
return false
}
logger.Debugf("> Found field %q in hits", f)
foundFields[f] = struct{}{}
}
return true
}()
Expand Down