From af577b0ad6bcbd32531d57fc984a98d1df21b977 Mon Sep 17 00:00:00 2001 From: Matheus Nogueira Date: Thu, 14 Sep 2023 21:50:24 -0300 Subject: [PATCH 1/2] fix: run state --- server/executor/trigger_result_processor_worker.go | 1 + 1 file changed, 1 insertion(+) 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) From ad5f36421581bc3194ec215130f864694a74c0e8 Mon Sep 17 00:00:00 2001 From: Matheus Nogueira Date: Thu, 14 Sep 2023 22:24:32 -0300 Subject: [PATCH 2/2] fix: condition for run state --- server/otlp/ingester.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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