refactor to use service.message_data.go
@@ -76,7 +76,7 @@ func TestProtocol_CleanOldPendingMessages(t *testing.T) {
fnd1.RegisterMsgHandler(1, handler)
n2 := sim.NewNode()
- fnd2 := NewProtocol(n2, protocol, 5*time.Second)
+ fnd2 := NewProtocol(n2, protocol, 10*time.Millisecond)
//send request with handler that converts to string and sends via channel
strCh := make(chan string)
@@ -88,6 +88,6 @@ func TestProtocol_CleanOldPendingMessages(t *testing.T) {
err := fnd2.SendAsyncRequest(1, nil, n1.PublicKey().String(), callback)
assert.NoError(t, err, "Should not return error")
assert.EqualValues(t, 1, fnd2.pendingQueue.Len(), "value received did not match correct value")
- time.Sleep(time.Second * 6)
+ time.Sleep(time.Second * 2)
assert.EqualValues(t, 0, fnd2.pendingQueue.Len(), "value received did not match correct value")
}
