summaryrefslogtreecommitdiff
path: root/tests/plugins
diff options
context:
space:
mode:
Diffstat (limited to 'tests/plugins')
-rw-r--r--tests/plugins/informer/informer_test.go11
-rw-r--r--tests/plugins/informer/test_plugin.go4
2 files changed, 9 insertions, 6 deletions
diff --git a/tests/plugins/informer/informer_test.go b/tests/plugins/informer/informer_test.go
index b6f50fd5..d40d7093 100644
--- a/tests/plugins/informer/informer_test.go
+++ b/tests/plugins/informer/informer_test.go
@@ -64,10 +64,7 @@ func TestInformerInit(t *testing.T) {
select {
case e := <-ch:
assert.Fail(t, "error", e.Error.Error())
- err = cont.Stop()
- if err != nil {
- assert.FailNow(t, "error", err.Error())
- }
+ return
case <-sig:
err = cont.Stop()
if err != nil {
@@ -113,9 +110,11 @@ func informerListRPCTest(t *testing.T) {
assert.NoError(t, err)
client := rpc.NewClientWithCodec(goridgeRpc.NewClientCodec(conn))
// WorkerList contains list of workers.
- list := make([]string, 0, 0)
+ list := make([]string, 0, 5)
+ // Plugins which are expected to be in the list
+ expected := []string{"rpc", "logs", "informer.plugin1", "config", "server"}
err = client.Call("informer.List", true, &list)
assert.NoError(t, err)
- assert.Equal(t, "informer.plugin1", list[0])
+ assert.ElementsMatch(t, list, expected)
}
diff --git a/tests/plugins/informer/test_plugin.go b/tests/plugins/informer/test_plugin.go
index 0c9065a3..db757110 100644
--- a/tests/plugins/informer/test_plugin.go
+++ b/tests/plugins/informer/test_plugin.go
@@ -49,6 +49,10 @@ func (p1 *Plugin1) Name() string {
return "informer.plugin1"
}
+func (p1 *Plugin1) Available() bool {
+ return true
+}
+
func (p1 *Plugin1) Workers() []process.State {
p, err := p1.server.NewWorkerPool(context.Background(), testPoolConfig, nil)
if err != nil {