diff --git a/tests/test_media_delivery_sql.c b/tests/test_media_delivery_sql.c index c0a0de6c..741054e1 100644 --- a/tests/test_media_delivery_sql.c +++ b/tests/test_media_delivery_sql.c @@ -13,6 +13,7 @@ static sqlite3_int64 scalar(sqlite3* db, const char* command) { int main(void) { debug_config_init(); debug_set_level(DEBUG_LEVEL_ERROR); + debug_set_category_level(DEBUG_CATEGORY_DEBUG, DEBUG_LEVEL_INFO); ua = uasync_create(); REQUIRE(ua); struct UTUN_INSTANCE* a = instance(SERVER); uint8_t epoch[16]; memcpy(epoch, a->md.source_epoch, 16); @@ -54,6 +55,6 @@ int main(void) { REQUIRE(!scalar(a->md.db, "SELECT COUNT(*) FROM super_sync")); REQUIRE(scalar(a->md.db, "SELECT COUNT(*) FROM media_files") == 1); destroy(a); uasync_destroy(ua, 0); - DEBUG_ERROR(DEBUG_CATEGORY_DEBUG, "media catalog SQL restart/reset/preservation: PASS"); + DEBUG_INFO(DEBUG_CATEGORY_DEBUG, "media catalog SQL restart/reset/preservation: PASS"); return 0; } diff --git a/tests/test_media_replication.c b/tests/test_media_replication.c index 71576db2..8319f0d1 100644 --- a/tests/test_media_replication.c +++ b/tests/test_media_replication.c @@ -97,8 +97,12 @@ static void poll_ready(void) { for (int i = 0; i < 8; i++) uasync_poll(ua, 0); } static void expire(struct media_super_peer* p) { REQUIRE(p); p->deadline_tb = 0; uint64_t until = get_time_tb() + 10000; - while (!packet_count && get_time_tb() < until) uasync_poll(ua, 100); - REQUIRE(packet_count); + while (get_time_tb() < until) { + uasync_poll(ua, 100); + for (int i = 0; i < packet_count; i++) if (packets[i].data[0] == MEDIA_SUBCMD_SYNC_REQ + && packets[i].from == p->md->self_node_id && packets[i].to == p->peer_node_id && packets[i].group == p->group_id) return; + } + REQUIRE(0); } /* Вручную запросить настоящую страницу без подмены реализации SELECT/сериализации. */ @@ -394,6 +398,7 @@ static void test_backpressure(void) { int main(void) { debug_config_init(); debug_set_level(DEBUG_LEVEL_ERROR); srand(17); + debug_set_category_level(DEBUG_CATEGORY_DEBUG, DEBUG_LEVEL_INFO); ua = uasync_create(); REQUIRE(ua); capture_blocks = 1; test_group_boundary(); test_pages(); @@ -403,6 +408,6 @@ int main(void) { test_backpressure(); REQUIRE(cm_opened == cm_closed); uasync_destroy(ua, 0); - DEBUG_ERROR(DEBUG_CATEGORY_DEBUG, "media replication regressions: PASS CM=%d/%d", cm_opened, cm_closed); + DEBUG_INFO(DEBUG_CATEGORY_DEBUG, "media replication regressions: PASS CM=%d/%d", cm_opened, cm_closed); return 0; }