From 7e25bac13edd8af2a57df83661421a5c74ec9cf5 Mon Sep 17 00:00:00 2001
From: Jono Wenger <jono@elixxir.io>
Date: Fri, 15 Oct 2021 15:49:58 -0700
Subject: [PATCH] Add sleep to TestManager_StartProcesses_Stop to fix
 intermittent failure

---
 single/manager_test.go | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/single/manager_test.go b/single/manager_test.go
index d39febc07..a1658a0b7 100644
--- a/single/manager_test.go
+++ b/single/manager_test.go
@@ -186,6 +186,11 @@ func TestManager_StartProcesses_Stop(t *testing.T) {
 		t.Errorf("Failed to close: %+v", err)
 	}
 
+	// Wait for the stoppable to close
+	for !stop.IsStopped() {
+		time.Sleep(10 * time.Millisecond)
+	}
+
 	m.swb.(*switchboard.Switchboard).Speak(receiveMsg)
 
 	timer := time.NewTimer(50 * time.Millisecond)
-- 
GitLab