Skip to content

Commit

Permalink
fix RunBlockingWait
Browse files Browse the repository at this point in the history
  • Loading branch information
endorama committed Jan 9, 2025
1 parent 991a9f1 commit 34530df
Showing 1 changed file with 2 additions and 13 deletions.
15 changes: 2 additions & 13 deletions functionaltests/internal/gen/generator.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,17 +86,6 @@ func (g *Generator) RunBlockingWait(ctx context.Context, ecc *esclient.Client, e
}
return equal
}
getDocsCount := func() (map[string]int, error) {
res := map[string]int{}
docCounts, err := ecc.ApmDocCount(ctx)
if err != nil {
return res, fmt.Errorf("cannot retrieve APM doc count: %w", err)
}
for _, dc := range docCounts {
res[dc.Datastream] = dc.Count
}
return res, nil
}

ticker := time.NewTicker(5 * time.Second)
defer ticker.Stop()
Expand All @@ -107,9 +96,9 @@ func (g *Generator) RunBlockingWait(ctx context.Context, ecc *esclient.Client, e
case <-tctx.Done():
return nil
case <-ticker.C:
docsCount, err := getDocsCount()
docsCount, err := ecc.ApmDocCount(ctx)
if err != nil {
return err
return fmt.Errorf("cannot retrieve APM doc count: %w", err)
}
if checkDocsCount(docsCount) {
return nil
Expand Down

0 comments on commit 34530df

Please sign in to comment.