fix: poll for burst stabilization in MIDI stop test
Co-authored-by: aider (deepseek/deepseek-reasoner) <aider@aider.chat>
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user