X-Git-Url: https://git.lttng.org/?p=lttng-tools.git;a=blobdiff_plain;f=tests%2Fregression%2Ftools%2Fnotification%2Fnotification.c;h=cc42e6153c452bb209d887a68e14812286e4fc6c;hp=535a71fce7fd8b5cbda2fa9a4086866b4d372007;hb=a3ecaea889e67f87307cc3be53e51fb472a67c3b;hpb=f12eb9c1ceb619db54be0842323a32cda12651cd diff --git a/tests/regression/tools/notification/notification.c b/tests/regression/tools/notification/notification.c index 535a71fce..cc42e6153 100644 --- a/tests/regression/tools/notification/notification.c +++ b/tests/regression/tools/notification/notification.c @@ -21,9 +21,9 @@ #include #include #include -#include #include +#include #include #include #include @@ -171,7 +171,7 @@ error: } static -int resume_application() +int resume_application(void) { int ret; struct stat buf; @@ -413,7 +413,7 @@ void test_notification_channel(const char *session_name, const char *channel_nam struct lttng_condition *dummy_condition = NULL; double low_ratio = 0.0; - double high_ratio = 0.99; + double high_ratio = 0.90; /* Set-up */ action = lttng_action_notify_create(); @@ -601,7 +601,9 @@ void test_notification_channel(const char *session_name, const char *channel_nam lttng_start_tracing(session_name); /* Wait for high notification */ - nc_status = lttng_notification_channel_get_next_notification(notification_channel, ¬ification); + do { + nc_status = lttng_notification_channel_get_next_notification(notification_channel, ¬ification); + } while (nc_status == LTTNG_NOTIFICATION_CHANNEL_STATUS_INTERRUPTED); ok(nc_status == LTTNG_NOTIFICATION_CHANNEL_STATUS_OK && notification && lttng_condition_get_type(lttng_notification_get_condition(notification)) == LTTNG_CONDITION_TYPE_BUFFER_USAGE_HIGH, @@ -625,7 +627,9 @@ void test_notification_channel(const char *session_name, const char *channel_nam nc_status = lttng_notification_channel_subscribe(notification_channel, low_condition); ok(nc_status == LTTNG_NOTIFICATION_CHANNEL_STATUS_OK, "subscribe with pending notification"); - nc_status = lttng_notification_channel_get_next_notification(notification_channel, ¬ification); + do { + nc_status = lttng_notification_channel_get_next_notification(notification_channel, ¬ification); + } while (nc_status == LTTNG_NOTIFICATION_CHANNEL_STATUS_INTERRUPTED); ok(nc_status == LTTNG_NOTIFICATION_CHANNEL_STATUS_OK && notification && lttng_condition_get_type(lttng_notification_get_condition(notification)) == LTTNG_CONDITION_TYPE_BUFFER_USAGE_LOW, @@ -638,7 +642,9 @@ void test_notification_channel(const char *session_name, const char *channel_nam resume_application(); lttng_start_tracing(session_name); - nc_status = lttng_notification_channel_get_next_notification(notification_channel, ¬ification); + do { + nc_status = lttng_notification_channel_get_next_notification(notification_channel, ¬ification); + } while (nc_status == LTTNG_NOTIFICATION_CHANNEL_STATUS_INTERRUPTED); ok(nc_status == LTTNG_NOTIFICATION_CHANNEL_STATUS_OK && notification && lttng_condition_get_type(lttng_notification_get_condition(notification)) == LTTNG_CONDITION_TYPE_BUFFER_USAGE_HIGH, "High notification received after intermediary communication"); @@ -650,7 +656,9 @@ void test_notification_channel(const char *session_name, const char *channel_nam resume_consumer(argv); wait_data_pending(session_name); - nc_status = lttng_notification_channel_get_next_notification(notification_channel, ¬ification); + do { + nc_status = lttng_notification_channel_get_next_notification(notification_channel, ¬ification); + } while (nc_status == LTTNG_NOTIFICATION_CHANNEL_STATUS_INTERRUPTED); ok(nc_status == LTTNG_NOTIFICATION_CHANNEL_STATUS_OK && notification && lttng_condition_get_type(lttng_notification_get_condition(notification)) == LTTNG_CONDITION_TYPE_BUFFER_USAGE_LOW, "Low notification received after re-subscription"); @@ -662,7 +670,9 @@ void test_notification_channel(const char *session_name, const char *channel_nam /* Stop consumer to force a high notification */ lttng_start_tracing(session_name); - nc_status = lttng_notification_channel_get_next_notification(notification_channel, ¬ification); + do { + nc_status = lttng_notification_channel_get_next_notification(notification_channel, ¬ification); + } while (nc_status == LTTNG_NOTIFICATION_CHANNEL_STATUS_INTERRUPTED); ok(nc_status == LTTNG_NOTIFICATION_CHANNEL_STATUS_OK && notification && lttng_condition_get_type(lttng_notification_get_condition(notification)) == LTTNG_CONDITION_TYPE_BUFFER_USAGE_HIGH, "High notification");