From 69b2c64c4eff1df0dbea20bb9881eac8b6adac97 Mon Sep 17 00:00:00 2001 From: Xavier Delannoy Date: Tue, 5 Nov 2024 02:06:16 +0100 Subject: [PATCH] Fix issue #1703 protect the write to the map env.activities with env.locker --- internal/internal_workflow_testsuite.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/internal/internal_workflow_testsuite.go b/internal/internal_workflow_testsuite.go index 7cbf77552..54ca4a069 100644 --- a/internal/internal_workflow_testsuite.go +++ b/internal/internal_workflow_testsuite.go @@ -1412,6 +1412,8 @@ func (env *testWorkflowEnvironmentImpl) getActivityHandle(activityID, runID stri } func (env *testWorkflowEnvironmentImpl) setActivityHandle(activityID, runID string, handle *testActivityHandle) { + env.locker.Lock() + defer env.locker.Unlock() env.activities[env.makeUniqueActivityID(activityID, runID)] = handle }