diff options
author | Valery Piashchynski <[email protected]> | 2021-08-15 17:37:48 +0300 |
---|---|---|
committer | Valery Piashchynski <[email protected]> | 2021-08-15 17:37:48 +0300 |
commit | 7b81e9e8cbe85a006bb0878d5bf4e22d0350041e (patch) | |
tree | af12eda7294149f76a3a497536d46d97accd30db /tests/plugins | |
parent | 3d62e479b30c3068dbafe4b582c0222a166fdb99 (diff) |
Correct tests with toxics
Signed-off-by: Valery Piashchynski <[email protected]>
Diffstat (limited to 'tests/plugins')
-rw-r--r-- | tests/plugins/jobs/jobs_sqs_test.go | 9 | ||||
-rw-r--r-- | tests/plugins/jobs/jobs_with_toxics_test.go | 11 |
2 files changed, 12 insertions, 8 deletions
diff --git a/tests/plugins/jobs/jobs_sqs_test.go b/tests/plugins/jobs/jobs_sqs_test.go index 80c5e8f4..cb1f4486 100644 --- a/tests/plugins/jobs/jobs_sqs_test.go +++ b/tests/plugins/jobs/jobs_sqs_test.go @@ -51,7 +51,8 @@ func TestSQSInit(t *testing.T) { mockLogger.EXPECT().Warn("pipeline stopped", "pipeline", "test-1", "start", gomock.Any(), "elapsed", gomock.Any()).Times(1) mockLogger.EXPECT().Warn("pipeline stopped", "pipeline", "test-2", "start", gomock.Any(), "elapsed", gomock.Any()).Times(1) - mockLogger.EXPECT().Warn("sqs listener stopped").Times(2) + mockLogger.EXPECT().Warn("sqs listener stopped").AnyTimes() + mockLogger.EXPECT().Info("------> job poller stopped <------").AnyTimes() err = cont.RegisterAll( cfg, @@ -136,7 +137,8 @@ func TestSQSDeclare(t *testing.T) { mockLogger.EXPECT().Info("pipeline active", "pipeline", "test-3", "start", gomock.Any(), "elapsed", gomock.Any()).Times(1) mockLogger.EXPECT().Info("pipeline paused", "pipeline", "test-3", "driver", "sqs", "start", gomock.Any(), "elapsed", gomock.Any()).Times(1) mockLogger.EXPECT().Warn("pipeline stopped", "pipeline", "test-3", "start", gomock.Any(), "elapsed", gomock.Any()).Times(1) - mockLogger.EXPECT().Warn("sqs listener stopped").Times(1) + mockLogger.EXPECT().Warn("sqs listener stopped").AnyTimes() + mockLogger.EXPECT().Info("------> job poller stopped <------").AnyTimes() err = cont.RegisterAll( cfg, @@ -233,7 +235,8 @@ func TestSQSJobsError(t *testing.T) { mockLogger.EXPECT().Info("pipeline paused", "pipeline", "test-3", "driver", "sqs", "start", gomock.Any(), "elapsed", gomock.Any()).Times(1) mockLogger.EXPECT().Warn("pipeline stopped", "pipeline", "test-3", "start", gomock.Any(), "elapsed", gomock.Any()).Times(1) - mockLogger.EXPECT().Warn("sqs listener stopped").Times(1) + mockLogger.EXPECT().Warn("sqs listener stopped").AnyTimes() + mockLogger.EXPECT().Info("------> job poller stopped <------").AnyTimes() err = cont.RegisterAll( cfg, diff --git a/tests/plugins/jobs/jobs_with_toxics_test.go b/tests/plugins/jobs/jobs_with_toxics_test.go index 627b32f0..bf71ed9e 100644 --- a/tests/plugins/jobs/jobs_with_toxics_test.go +++ b/tests/plugins/jobs/jobs_with_toxics_test.go @@ -176,13 +176,13 @@ func TestDurabilitySQS(t *testing.T) { mockLogger.EXPECT().Warn("pipeline stopped", "pipeline", "test-1", "start", gomock.Any(), "elapsed", gomock.Any()).Times(1) mockLogger.EXPECT().Warn("pipeline stopped", "pipeline", "test-2", "start", gomock.Any(), "elapsed", gomock.Any()).Times(1) - mockLogger.EXPECT().Info("------> job poller stopped <------").AnyTimes() - mockLogger.EXPECT().Warn("sqs listener stopped").MinTimes(2) - // redial errors mockLogger.EXPECT().Error("pipeline error", "pipeline", "test-1", "error", gomock.Any(), "start", gomock.Any(), "elapsed", gomock.Any()).AnyTimes() mockLogger.EXPECT().Error("pipeline error", "pipeline", "test-2", "error", gomock.Any(), "start", gomock.Any(), "elapsed", gomock.Any()).AnyTimes() - mockLogger.EXPECT().Info("queues and subscribers redeclared successfully").AnyTimes() + + // stop + mockLogger.EXPECT().Warn("sqs listener stopped").AnyTimes() + mockLogger.EXPECT().Info("------> job poller stopped <------").AnyTimes() err = cont.RegisterAll( cfg, @@ -246,8 +246,9 @@ func TestDurabilitySQS(t *testing.T) { time.Sleep(time.Second * 3) go func() { - time.Sleep(time.Second * 2) + time.Sleep(time.Second * 1) t.Run("PushPipelineWhileRedialing-1", pushToPipe("test-1")) + time.Sleep(time.Second) t.Run("PushPipelineWhileRedialing-2", pushToPipe("test-2")) }() |