From 63e3d1d76e6e6fab4bac5851bf66c2481b32052a Mon Sep 17 00:00:00 2001 From: Rafael Date: Sun, 16 May 2021 16:58:26 +1200 Subject: [PATCH] chore clean-up tests to latest ginko version --- registry/nodeService_test.go | 6 ++---- registry/registry_test.go | 10 ++++------ transit/nats/nats_test.go | 10 ++++------ 3 files changed, 10 insertions(+), 16 deletions(-) diff --git a/registry/nodeService_test.go b/registry/nodeService_test.go index dbfa472e..71b8c475 100644 --- a/registry/nodeService_test.go +++ b/registry/nodeService_test.go @@ -71,9 +71,9 @@ func findBy(field, value string, list []moleculer.Payload) []map[string]interfac var _ = Describe("nodeService", func() { Describe("Local Service $node", func() { - harness := func(action string, scenario string, params map[string]interface{}, transformer func(interface{}) interface{}) func(done Done) { + harness := func(action string, scenario string, params map[string]interface{}, transformer func(interface{}) interface{}) func() { label := fmt.Sprint(scenario, "-", action) - return func(done Done) { + return func() { mem := &memory.SharedMemory{} printerBroker := createPrinterBroker(mem) @@ -101,8 +101,6 @@ var _ = Describe("nodeService", func() { result = <-cpuBroker.Call(action, params) Expect(result.Exists()).Should(BeTrue()) Expect(snap.SnapshotMulti(fmt.Sprint(label, "cpuBroker"), transformer(result))).Should(Succeed()) //failed here perdeu o node priunter - - close(done) } } diff --git a/registry/registry_test.go b/registry/registry_test.go index afa7ac08..36828acb 100644 --- a/registry/registry_test.go +++ b/registry/registry_test.go @@ -149,7 +149,7 @@ var _ = Describe("Registry", func() { Describe("Auto discovery", func() { //failed with timeout - It("3 brokers should auto discovery and perform local and remote Calls", func(done Done) { + It("3 brokers should auto discovery and perform local and remote Calls", func() { mem := &memory.SharedMemory{} printerBroker := createPrinterBroker(mem) var serviceAdded, serviceRemoved []moleculer.Payload @@ -260,13 +260,12 @@ var _ = Describe("Registry", func() { <-scannerBroker.Call("scanner.scan", scanText) }).Should(Panic()) //broker B is stopped ... so it should panic - close(done) - }, 5) + }) }) Describe("Namespace", func() { - It("Services across namespaces cannos see each other", func(done Done) { + It("Services across namespaces cannos see each other", func() { mem := &memory.SharedMemory{} @@ -380,7 +379,6 @@ var _ = Describe("Registry", func() { stageBroker.Stop() stage2Broker.Stop() - close(done) - }, 2) + }) }) }) diff --git a/transit/nats/nats_test.go b/transit/nats/nats_test.go index c31f97c3..cfc6424b 100644 --- a/transit/nats/nats_test.go +++ b/transit/nats/nats_test.go @@ -69,7 +69,7 @@ var _ = Describe("NATS Streaming Transit", func() { }) - It("should make a remote call from profile broker a to user broker", func(done Done) { + It("should make a remote call from profile broker a to user broker", func() { userBroker.Start() profileBroker.Start() profileBroker.WaitFor("user") @@ -79,10 +79,9 @@ var _ = Describe("NATS Streaming Transit", func() { userBroker.Stop() profileBroker.Stop() - close(done) - }, 3) + }) - It("should fail after brokers are stopped", func(done Done) { + It("should fail after brokers are stopped", func() { userBroker.Start() profileBroker.Start() @@ -93,8 +92,7 @@ var _ = Describe("NATS Streaming Transit", func() { Expect((<-profileBroker.Call("user.update", longList)).IsError()).Should(BeTrue()) profileBroker.Stop() - close(done) - }, 3) + }) }) Describe("Start / Stop Cycles.", func() {