Fix flaky matching AddTaskStandby test
@@ -457,6 +457,7 @@ func TestAddTaskStandby(t *testing.T) {
// stop taskWriter so that we can check if there's any call to it
// otherwise the task persist process is async and hard to test
tlm.taskWriter.Stop()
+ <-tlm.taskWriter.writeLoop.Done()
addTaskParam := addTaskParams{
execution: &commonpb.WorkflowExecution{},
