Skip to content

Commit

Permalink
tests: internal: input_chunk: Use the different storage.path per tests
Browse files Browse the repository at this point in the history
This is because different storage.paths should be used per test.
Sometimes this cause failure for retrieving the file contents to prepare
the data for input_chunk test cases:

```log
Test input_chunk_exceed_limit...                [ FAILED ]
  input_chunk.c:91: Check getting output file content: ~/GitHub/fluent-bit/tests/internal/data/input_chunk/out/a_thousand_plus_one_bytes.out... failed
[2023/07/28 00:03:09] [error] [~/GitHub/fluent-bit/tests/internal/input_chunk.c:56 errno=0] Success
```

After splitting the storage.path per test case, this error won't happen.

Signed-off-by: Hiroshi Hatake <[email protected]>
  • Loading branch information
cosmo0920 authored and edsiper committed Sep 23, 2023
1 parent de6010e commit adf20cc
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion tests/internal/input_chunk.c
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,7 @@ void do_test(char *system, const char *target, ...)
int out_ffd;
char path[PATH_MAX];
struct tail_test_result result = {0};
char storage_path[PATH_MAX];

result.nMatched = 0;
result.target = target;
Expand All @@ -175,10 +176,12 @@ void do_test(char *system, const char *target, ...)

ctx = flb_create();

snprintf(storage_path, sizeof(storage_path) - 1, "/tmp/input-chunk-test-%s", target);

/* create chunks in /tmp folder */
ret = flb_service_set(ctx,
"Parsers_File", DPATH "parser.conf",
"storage.path", "/tmp/input-chunk-test/",
"storage.path", storage_path,
"Log_Level", "error",
NULL);
TEST_CHECK_(ret == 0, "setting service options");
Expand Down

0 comments on commit adf20cc

Please sign in to comment.