diff --git a/server/executor/trigger_result_processor_worker.go b/server/executor/trigger_result_processor_worker.go index 498317dd27..02c2c6cdee 100644 --- a/server/executor/trigger_result_processor_worker.go +++ b/server/executor/trigger_result_processor_worker.go @@ -91,6 +91,7 @@ func (r triggerResultProcessorWorker) ProcessItem(ctx context.Context, job Job) } } + job.Run.State = test.RunStateAwaitingTrace r.handleDBError(job.Run, r.updater.Update(ctx, job.Run)) r.outputQueue.Enqueue(ctx, job) diff --git a/server/otlp/ingester.go b/server/otlp/ingester.go index 8777f083e7..df9a30515c 100644 --- a/server/otlp/ingester.go +++ b/server/otlp/ingester.go @@ -145,8 +145,8 @@ func (i ingester) getOngoinTestRunForTrace(ctx context.Context, trace traces.Tra return test.Run{}, fmt.Errorf("error getting run by traceID: %w", err) } - if run.State != test.RunStateAwaitingTrace { - return test.Run{}, errNoTestRun + if run.State != test.RunStateAwaitingTrace && run.State != test.RunStateExecuting { + return test.Run{}, fmt.Errorf("test run is not awaiting trace nor executing. Actual state: %s", run.State) } return run, nil