Wait for actual retry requests independently of change hints

This commit is contained in:
evgeny committed 2026-10-22 21:12:58 +02:00
1 parent a011c57237
commit f2283eff6b
2 files changed
+10 -4

No files matched your search

+2 -1
View File
@@ -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;
}
+8 -3
View File
@@ -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;
}