Browse Source

rpc/test: wait for subscription in TestTxEventsSentWithBroadcastTxAsync (#4907)

Mitigates race condition causing these test failures:

```
=== RUN   TestTxEventsSentWithBroadcastTxAsync
=== RUN   TestTxEventsSentWithBroadcastTxAsync/*http.HTTP
I[2020-05-25|12:29:08.477] Starting WSEvents service                    impl=WSEvents
    TestTxEventsSentWithBroadcastTxAsync/*http.HTTP: event_test.go:124: 
        	Error Trace:	event_test.go:124
        	Error:      	Expected nil, but got: &errors.errorString{s:"timed out waiting for event"}
        	Test:       	TestTxEventsSentWithBroadcastTxAsync/*http.HTTP
        	Messages:   	0: timed out waiting for event
```
pull/4911/head
Erik Grinaker 4 years ago
committed by GitHub
parent
commit
e69a3d9703
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 0 deletions
  1. +3
    -0
      rpc/client/event_test.go

+ 3
- 0
rpc/client/event_test.go View File

@ -98,6 +98,9 @@ func testTxEventsSent(t *testing.T, broadcastMethod string) {
defer c.Stop()
}
// wait for the client subscription to get set up
time.Sleep(100 * time.Millisecond)
// make the tx
_, _, tx := MakeTxKV()
evtTyp := types.EventTx


Loading…
Cancel
Save