Attaching a debugger to the `notification` test application causes
tests to fail when the application is waiting for a notification
as the function will return an `INTERRUPTED` status code.
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Change-Id: I4ac9ac13d02a96366791e81746e53bb5dde94885
lttng_start_tracing(session_name);
/* Wait for high notification */
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,
ok(nc_status == LTTNG_NOTIFICATION_CHANNEL_STATUS_OK
&& notification
&& lttng_condition_get_type(lttng_notification_get_condition(notification)) == LTTNG_CONDITION_TYPE_BUFFER_USAGE_HIGH,
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_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,
ok(nc_status == LTTNG_NOTIFICATION_CHANNEL_STATUS_OK
&& notification
&& lttng_condition_get_type(lttng_notification_get_condition(notification)) == LTTNG_CONDITION_TYPE_BUFFER_USAGE_LOW,
resume_application();
lttng_start_tracing(session_name);
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");
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");
resume_consumer(argv);
wait_data_pending(session_name);
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");
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");
/* Stop consumer to force a high notification */
lttng_start_tracing(session_name);
/* 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");
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");