diff --git a/broadcastclient/broadcastclient_test.go b/broadcastclient/broadcastclient_test.go index b75bc44c11..84356d77e0 100644 --- a/broadcastclient/broadcastclient_test.go +++ b/broadcastclient/broadcastclient_test.go @@ -232,7 +232,21 @@ func startMakeBroadcastClient(ctx context.Context, t *testing.T, clientConfig Co go func() { defer wg.Done() - defer broadcastClient.StopAndWait() + // drain messages so messages could be sent on ts.messageReceiver + defer func() { + clientDone := make(chan struct{}) + go func() { + for { + select { + case <-ts.messageReceiver: + case <-clientDone: + return + } + } + }() + broadcastClient.StopAndWait() + close(clientDone) + }() var timeout time.Duration if expectedCount == 0 { timeout = 1 * time.Second diff --git a/contracts b/contracts index cd5093d45e..a8e7709bfc 160000 --- a/contracts +++ b/contracts @@ -1 +1 @@ -Subproject commit cd5093d45ef0353fc5b2718ead70bd7f36e1a92c +Subproject commit a8e7709bfc918f9b8e2888d47f2fd8454779fd11