fix: poll for burst stabilization in MIDI stop test

Co-authored-by: aider (deepseek/deepseek-reasoner) <aider@aider.chat>
This commit is contained in:
Loic Coenen
2026-05-10 12:36:13 +00:00
parent 5b1969415f
commit ffe422d83f

View File

@@ -1135,9 +1135,16 @@ static int test_stop_midi(void) {
fprintf(stderr, " FAIL: stop note 65\n"); fprintf(stderr, " FAIL: stop note 65\n");
return 1; 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; int bursts_before = bursts;
safe_usleep(1000000); safe_usleep(500000);
int bursts_after = bursts; int bursts_after = bursts;
jack_deactivate(client); jack_deactivate(client);
jack_client_close(client); jack_client_close(client);