summaryrefslogtreecommitdiff
path: root/tests/plugins/informer/informer_test.go
diff options
context:
space:
mode:
authorValery Piashchynski <[email protected]>2021-06-02 21:23:42 +0300
committerGitHub <[email protected]>2021-06-02 21:23:42 +0300
commit9c01e7ab1548e1416598b702d63866fa6dc5707b (patch)
tree35056e2a44cc8427b857399a9eb154c15986d22e /tests/plugins/informer/informer_test.go
parenta99c14abb333c10a9142cd2f178e001f1b1726fb (diff)
parent42c0d32eb2e28fee3d084d887552b1ebafdd66c6 (diff)
#699 fix(bug): return `nil` if there are no workers in the requested pluginv2.3.0-beta.1
#699 fix(bug): return `nil` if there are no workers in the requested plugin
Diffstat (limited to 'tests/plugins/informer/informer_test.go')
-rw-r--r--tests/plugins/informer/informer_test.go16
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/plugins/informer/informer_test.go b/tests/plugins/informer/informer_test.go
index d40d7093..61be85a1 100644
--- a/tests/plugins/informer/informer_test.go
+++ b/tests/plugins/informer/informer_test.go
@@ -85,11 +85,27 @@ func TestInformerInit(t *testing.T) {
time.Sleep(time.Second)
t.Run("InformerWorkersRpcTest", informerWorkersRPCTest)
t.Run("InformerListRpcTest", informerListRPCTest)
+ t.Run("InformerPluginWithoutWorkersRpcTest", informerPluginWOWorkersRPCTest)
stopCh <- struct{}{}
wg.Wait()
}
+func informerPluginWOWorkersRPCTest(t *testing.T) {
+ conn, err := net.Dial("tcp", "127.0.0.1:6001")
+ assert.NoError(t, err)
+ client := rpc.NewClientWithCodec(goridgeRpc.NewClientCodec(conn))
+ // WorkerList contains list of workers.
+ list := struct {
+ // Workers is list of workers.
+ Workers []process.State `json:"workers"`
+ }{}
+
+ err = client.Call("informer.Workers", "informer.config", &list)
+ assert.NoError(t, err)
+ assert.Len(t, list.Workers, 0)
+}
+
func informerWorkersRPCTest(t *testing.T) {
conn, err := net.Dial("tcp", "127.0.0.1:6001")
assert.NoError(t, err)