Skip to content

Commit

Permalink
testing: cv_wait_example: relax max waiting time
Browse files Browse the repository at this point in the history
  • Loading branch information
clementperon committed Jul 2, 2024
1 parent 6bce2c5 commit 88daf00
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions testing/cv_wait_example_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -150,19 +150,19 @@ static void example_cv_wait (testing t) {
memset (&output, 0, sizeof (output));

closure_fork (closure_add_and_wait_cv (&add_and_wait_cv, &q,
nsync_time_ms (500), NELEM (input), input));
nsync_time_ms (1000), NELEM (input), input));

/* delay: "one", "two", "three" are queued; not "four" */
nsync_time_sleep (nsync_time_ms (1200));

remove_and_print_cv (&q, nsync_time_ms (1000), &output); /* "one" */
remove_and_print_cv (&q, nsync_time_ms (1000), &output); /* "three" (less than "two") */
remove_and_print_cv (&q, nsync_time_ms (1000), &output); /* "two" */
remove_and_print_cv (&q, nsync_time_ms (100), &output); /* time out because 1.3 < 0.5*3 */
remove_and_print_cv (&q, nsync_time_ms (1000), &output); /* "four" */
remove_and_print_cv (&q, nsync_time_ms (100), &output); /* time out because 0.1 < 0.5 */
remove_and_print_cv (&q, nsync_time_ms (1000), &output); /* "five" */
remove_and_print_cv (&q, nsync_time_ms (1000), &output); /* time out: no more to fetch */
nsync_time_sleep (nsync_time_ms (2400));

remove_and_print_cv (&q, nsync_time_ms (2000), &output); /* "one" */
remove_and_print_cv (&q, nsync_time_ms (2000), &output); /* "three" (less than "two") */
remove_and_print_cv (&q, nsync_time_ms (2000), &output); /* "two" */
remove_and_print_cv (&q, nsync_time_ms (200), &output); /* time out because 1.3 < 0.5*3 */
remove_and_print_cv (&q, nsync_time_ms (2000), &output); /* "four" */
remove_and_print_cv (&q, nsync_time_ms (200), &output); /* time out because 0.1 < 0.5 */
remove_and_print_cv (&q, nsync_time_ms (2000), &output); /* "five" */
remove_and_print_cv (&q, nsync_time_ms (2000), &output); /* time out: no more to fetch */

A_PUSH (&output) = 0;
if (strcmp (&A (&output, 0), expected) != 0) {
Expand Down

0 comments on commit 88daf00

Please sign in to comment.