Isolate stream wake state and require full roots in sync stress
This commit is contained in:
1 parent
e00d1f5212
commit
f92077e601
2 files changed
+9
-2
No files matched your search
@@ -99,16 +99,21 @@ static void cleanup_temp_configs(void) {
|
||||
|
||||
static void test_timeout(void* arg) { (void)arg; test_phase = 2; }
|
||||
|
||||
static int histories_match(void) {
|
||||
uint8_t a[32], b[32];
|
||||
return db_sync_count(si_a) == expected_total && db_sync_count(si_b) == expected_total
|
||||
&& db_sync_read_root(si_a, a) == 0 && db_sync_read_root(si_b, b) == 0 && !memcmp(a, b, 32);
|
||||
}
|
||||
static int wait_for(const char* desc, int timeout_tb, uint64_t* elapsed_out) {
|
||||
uint64_t start = get_time_tb();
|
||||
uint32_t ca0 = si_a ? db_sync_count(si_a) : 0, cb0 = si_b ? db_sync_count(si_b) : 0;
|
||||
DEBUG_WARN(DEBUG_CATEGORY_DEBUG, "SYNC_START %s A=%u B=%u expect=%u", desc, ca0, cb0, expected_total);
|
||||
while ((db_sync_count(si_a) != expected_total || db_sync_count(si_b) != expected_total)
|
||||
while (!histories_match()
|
||||
&& (get_time_tb() - start) < (uint64_t)timeout_tb && test_phase == 0)
|
||||
uasync_poll(ua, POLL_INTERVAL_MS);
|
||||
uint32_t ca = si_a ? db_sync_count(si_a) : 0, cb = si_b ? db_sync_count(si_b) : 0;
|
||||
uint64_t elapsed = (get_time_tb() - start) / 10;
|
||||
int ok = (ca == expected_total && cb == expected_total);
|
||||
int ok = histories_match();
|
||||
if (ok)
|
||||
DEBUG_WARN(DEBUG_CATEGORY_DEBUG, "SYNC_DONE %s A=%u B=%u %llums", desc, ca, cb, (unsigned long long)elapsed);
|
||||
else {
|
||||
|
||||
@@ -2314,6 +2314,8 @@ static void test_partial_bootstrap_and_end(void) {
|
||||
static void test_sources_after_wake(void) {
|
||||
debug_level_t level = g_debug_config.category_levels[DEBUG_CATEGORY_KEEPALIVE];
|
||||
debug_set_category_level(DEBUG_CATEGORY_KEEPALIVE, DEBUG_LEVEL_INFO);
|
||||
/* Предыдущий recovery оставляет центральный mobile-узел в standby; здесь спит только проверяемый получатель. */
|
||||
CHECK(utun_set_client_activity(nodes[0], CLIENT_ACTIVITY_ACTIVE) == 0);
|
||||
CHECK(utun_set_client_activity(nodes[2], 1) == 0);
|
||||
/* Каналы стенда внесены напрямую в БД после init; ждём первого обновления кеша chat_sync (5 с). */
|
||||
test_clock_run_for(ua, 51000);
|
||||
|
||||
Reference in new issue
Block a user