From 90b90738f16c3ebf1b17483fbabeb7c6920ebaef Mon Sep 17 00:00:00 2001 From: evgeny Date: Tue, 3 Nov 2026 16:31:13 +0100 Subject: [PATCH] Seed completed admission in isolated history synchronization tests --- tests/test_chat_sync_stress.c | 4 ++++ tests/test_db_sync.c | 2 ++ 2 files changed, 6 insertions(+) diff --git a/tests/test_chat_sync_stress.c b/tests/test_chat_sync_stress.c index ae1252b5e..485e30184 100644 --- a/tests/test_chat_sync_stress.c +++ b/tests/test_chat_sync_stress.c @@ -137,6 +137,10 @@ static void seed_members(struct UTUN_INSTANCE* self, struct UTUN_INSTANCE* peer) NULL, 0, peer->my_keys.public_key, peer->my_ed25519_pubkey, "{}", NULL, 0, z64) < 0) { DEBUG_ERROR(DEBUG_CATEGORY_CHAT_SYNC, "stress member fixture failed peer=%016llx", (unsigned long long)peer->node_id); abort(); } + if (topo_node_sqlite_member_block_put(db, ch_id, self->node_id, z64, 1, NULL, 0, + self->my_keys.public_key, self->my_ed25519_pubkey, "{}", NULL, 0, z64) < 0) abort(); + char admission[96]; snprintf(admission, sizeof(admission), "UPDATE peers_%s SET admitted=1", ch_id); + if (sqlite3_exec(db, admission, NULL, NULL, NULL) != SQLITE_OK) abort(); if (!topo_groups_find(self->topo_groups, INSTANCE_ID)) topo_groups_create_group(self->topo_groups, INSTANCE_ID, TOPO_GROUP_TYPE_CHAT, ch_id); } diff --git a/tests/test_db_sync.c b/tests/test_db_sync.c index c007d84ae..3d46844f1 100644 --- a/tests/test_db_sync.c +++ b/tests/test_db_sync.c @@ -239,6 +239,8 @@ static void seed_members(struct UTUN_INSTANCE* self, struct UTUN_INSTANCE** peer DEBUG_ERROR(DEBUG_CATEGORY_CHAT_SYNC, "member fixture failed peer=%016llx", (unsigned long long)peer->node_id); abort(); } } + char admission[96]; snprintf(admission, sizeof(admission), "UPDATE peers_%s SET admitted=1", groups[gi]); + if (sqlite3_exec(db, admission, NULL, NULL, NULL) != SQLITE_OK) abort(); uint64_t gid = strtoull(groups[gi], NULL, 10); if (!topo_groups_find(self->topo_groups, gid)) topo_groups_create_group(self->topo_groups, gid, TOPO_GROUP_TYPE_CHAT, groups[gi]);