diff --git a/internal/testrunner/runners/system/tester.go b/internal/testrunner/runners/system/tester.go index 9af5dc54c3..6c8dd464a7 100644 --- a/internal/testrunner/runners/system/tester.go +++ b/internal/testrunner/runners/system/tester.go @@ -1396,14 +1396,6 @@ func (r *tester) prepareScenario(ctx context.Context, config *testConfig, stackC return hits.size() > 0, nil }, 1*time.Second, waitForDataTimeout) - // Get deprecation warnings after ensuring that there are ingested docs and thus the - // data stream exists. - scenario.deprecationWarnings, err = r.getDeprecationWarnings(ctx, scenario.dataStream) - if err != nil { - return nil, fmt.Errorf("failed to get deprecation warnings for data stream %s: %w", scenario.dataStream, err) - } - logger.Debugf("Found %d deprecation warnings for data stream %s", len(scenario.deprecationWarnings), scenario.dataStream) - if service != nil && config.Service != "" && !config.IgnoreServiceError { exited, code, err := service.ExitCode(ctx, config.Service) if err != nil && !errors.Is(err, servicedeployer.ErrNotSupported) { @@ -1422,6 +1414,14 @@ func (r *tester) prepareScenario(ctx context.Context, config *testConfig, stackC return nil, testrunner.ErrTestCaseFailed{Reason: fmt.Sprintf("could not find hits in %s data stream", scenario.dataStream)} } + // Get deprecation warnings after ensuring that there are ingested docs and thus the + // data stream exists. + scenario.deprecationWarnings, err = r.getDeprecationWarnings(ctx, scenario.dataStream) + if err != nil { + return nil, fmt.Errorf("failed to get deprecation warnings for data stream %s: %w", scenario.dataStream, err) + } + logger.Debugf("Found %d deprecation warnings for data stream %s", len(scenario.deprecationWarnings), scenario.dataStream) + logger.Debugf("Check whether or not synthetic source mode is enabled (data stream %s)...", scenario.dataStream) scenario.syntheticEnabled, err = isSyntheticSourceModeEnabled(ctx, r.esAPI, scenario.dataStream) if err != nil {