From 2980775e676f88ddbdcfff9465eb5bff2884bfd3 Mon Sep 17 00:00:00 2001 From: ionutboangiu Date: Fri, 7 Jun 2024 11:59:56 +0300 Subject: [PATCH] Revise test for ReplayFailedPosts API - shortened the failed post cache ttl to 1ms to simulate with more than one events file - use the default FailedPath (which is the same as SourcePath) to check whether writing events that failed to be replayed to the same path would cause an infinite loop. --- general_tests/ees_it_test.go | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/general_tests/ees_it_test.go b/general_tests/ees_it_test.go index b8ce63bb3..ca13286c5 100644 --- a/general_tests/ees_it_test.go +++ b/general_tests/ees_it_test.go @@ -349,7 +349,7 @@ func TestEEsReplayFailedPosts(t *testing.T) { "general": { "log_level": 7, - "failed_posts_ttl": "3ms", + "failed_posts_ttl": "1ms", "poster_attempts": 1 }, @@ -474,11 +474,9 @@ func TestEEsReplayFailedPosts(t *testing.T) { } time.Sleep(5 * time.Millisecond) - replayFailedDir := t.TempDir() var replayReply string if err := client.Call(context.Background(), utils.APIerSv1ReplayFailedPosts, v1.ReplayFailedPostsParams{ SourcePath: failedDir, - FailedPath: replayFailedDir, Modules: []string{"test", "EEs"}, }, &replayReply); err != nil { t.Errorf("APIerSv1.ReplayFailedPosts returned unexpected err: %v", err) @@ -504,8 +502,7 @@ func TestEEsReplayFailedPosts(t *testing.T) { } if err := client.Call(context.Background(), utils.APIerSv1ReplayFailedPosts, v1.ReplayFailedPostsParams{ - SourcePath: replayFailedDir, - FailedPath: utils.MetaNone, + SourcePath: failedDir, Modules: []string{"test", "EEs"}, }, &replayReply); err != nil { t.Errorf("APIerSv1.ReplayFailedPosts returned unexpected err: %v", err)