- (void) poll(NULL, 0, 10); /* 10 ms delay */
- continue; /* retry */
+ /*
+ * The file does not exist. wait a bit and
+ * continue looping until it does.
+ */
+ (void) poll(NULL, 0, 10);
+ continue;
- ok(loop_ret == -LTTNG_ERR_TRIGGER_NOT_FOUND, "Unregister of a non-registerd trigger fails as expected: %s", test_tuple_string);
+ ok(loop_ret == -LTTNG_ERR_TRIGGER_NOT_FOUND, "Unregister of a non-registered trigger fails as expected: %s", test_tuple_string);
} else {
ok(loop_ret == -LTTNG_ERR_INVALID_TRIGGER, "Trigger is invalid as expected and cannot be registered: %s", test_tuple_string);
}
} else {
ok(loop_ret == -LTTNG_ERR_INVALID_TRIGGER, "Trigger is invalid as expected and cannot be registered: %s", test_tuple_string);
}
ok(nc_status == LTTNG_NOTIFICATION_CHANNEL_STATUS_INVALID, "Subscribing to an invalid condition");
nc_status = lttng_notification_channel_unsubscribe(notification_channel, dummy_invalid_condition);
ok(nc_status == LTTNG_NOTIFICATION_CHANNEL_STATUS_INVALID, "Subscribing to an invalid condition");
nc_status = lttng_notification_channel_unsubscribe(notification_channel, dummy_invalid_condition);
/* Subscribe a valid low condition */
nc_status = lttng_notification_channel_subscribe(notification_channel, low_condition);
/* Subscribe a valid low condition */
nc_status = lttng_notification_channel_subscribe(notification_channel, low_condition);
- 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,
- 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");
- 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");
- 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");