query: test returns nil nil when disconnected
This commit is contained in:
+10
-3
@@ -648,9 +648,16 @@ func TestRequestManager_Query(t *testing.T) {
|
|||||||
})
|
})
|
||||||
|
|
||||||
t.Run("returns nil nil when disconnected", func(t *testing.T) {
|
t.Run("returns nil nil when disconnected", func(t *testing.T) {
|
||||||
// do not connect the envoy
|
_, envoy := newMockEnvoy(t)
|
||||||
// call Query
|
// do not connect
|
||||||
// assert it returns immediately with nil events and nil closed
|
|
||||||
|
m := NewRequestManager(envoy)
|
||||||
|
t.Cleanup(func() { m.Close() })
|
||||||
|
|
||||||
|
events, closed := m.Query([][]byte{[]byte(`{}`)}, TestTimeout)
|
||||||
|
|
||||||
|
assert.Nil(t, events)
|
||||||
|
assert.Nil(t, closed)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user