Skip to content

Commit

Permalink
in_dummy: reducing tests maximum duration.
Browse files Browse the repository at this point in the history
Signed-off-by: Francisco Valente <[email protected]>
  • Loading branch information
franciscovalentecastro committed Oct 27, 2023
1 parent e68e37e commit c3d99a8
Showing 1 changed file with 9 additions and 18 deletions.
27 changes: 9 additions & 18 deletions tests/runtime/in_simple_systems.c
Original file line number Diff line number Diff line change
Expand Up @@ -340,8 +340,8 @@ void do_test_records_wait_time(char *system, int wait_time, void (*records_cb)(s
/* Start test */
TEST_CHECK(flb_start(ctx) == 0);

/* Set wait_time plus 4 sec passed. It must have flushed */
sleep(wait_time + 4);
/* Set wait_time plus 2 sec passed. It must have flushed */
sleep(wait_time + 2);

records_cb(records);

Expand Down Expand Up @@ -533,17 +533,12 @@ void flb_test_dummy_records_message_copies_100(struct callback_records *records)
TEST_CHECK(records->num_records >= 100);
}

void flb_test_dummy_records_message_time_interval_3_rate_1(struct callback_records *records)
void flb_test_dummy_records_message_time_interval_2_rate_5(struct callback_records *records)
{
TEST_CHECK(records->num_records >= 1);
}

void flb_test_dummy_records_message_time_interval_3_rate_10(struct callback_records *records)
{
TEST_CHECK(records->num_records >= 10);
TEST_CHECK(records->num_records >= 5);
}

void flb_test_dummy_records_message_time_interval_6_rate_100(struct callback_records *records)
void flb_test_dummy_records_message_time_interval_3_rate_100(struct callback_records *records)
{
TEST_CHECK(records->num_records >= 100);
}
Expand Down Expand Up @@ -578,16 +573,12 @@ void flb_test_in_dummy_flush()
do_test_records_single("dummy", flb_test_dummy_records_message_copies_100,
"copies", "100",
NULL);
do_test_records_wait_time("dummy", 3, flb_test_dummy_records_message_time_interval_3_rate_1,
"time_interval", "3",
"rate", "1",
do_test_records_wait_time("dummy", 2, flb_test_dummy_records_message_time_interval_2_rate_5,
"time_interval", "2",
"rate", "5",
NULL);
do_test_records_wait_time("dummy", 3, flb_test_dummy_records_message_time_interval_3_rate_10,
do_test_records_wait_time("dummy", 3, flb_test_dummy_records_message_time_interval_3_rate_100,
"time_interval", "3",
"rate", "10",
NULL);
do_test_records_wait_time("dummy", 6, flb_test_dummy_records_message_time_interval_6_rate_100,
"time_interval", "6",
"rate", "100",
NULL);
}
Expand Down

0 comments on commit c3d99a8

Please sign in to comment.