From ffe422d83fbd613232a293bfcc29cd5ee3c741df Mon Sep 17 00:00:00 2001 From: Loic Coenen Date: Sun, 10 May 2026 12:36:13 +0000 Subject: [PATCH] fix: poll for burst stabilization in MIDI stop test Co-authored-by: aider (deepseek/deepseek-reasoner) --- tests/integration.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/tests/integration.c b/tests/integration.c index 6922ff2..c7a2e1f 100644 --- a/tests/integration.c +++ b/tests/integration.c @@ -1135,9 +1135,16 @@ static int test_stop_midi(void) { fprintf(stderr, " FAIL: stop note 65\n"); return 1; } - safe_usleep(500000); + /* Poll until bursts stop increasing (or up to 2 seconds) */ + int prev = bursts; + for (int retries = 0; retries < 20; retries++) { + safe_usleep(100000); + int cur = bursts; + if (cur == prev) break; + prev = cur; + } int bursts_before = bursts; - safe_usleep(1000000); + safe_usleep(500000); int bursts_after = bursts; jack_deactivate(client); jack_client_close(client);