Skip to content

Commit

Permalink
AudioEngineTests: add sleep in JACK offsets tests
Browse files Browse the repository at this point in the history
right after setting tempo. Else we get into race conditions yielding false positive results (since it is not a real use case that the user changes tempo and then triggeres a relocation _before_ the tempo was applied in the AudioEngine during the next process cycle)
  • Loading branch information
theGreatWhiteShark committed Oct 31, 2024
1 parent f5bc62a commit 557a16c
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/core/AudioEngine/AudioEngineTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2575,6 +2575,12 @@ void AudioEngineTests::testTransportRelocationOffsetsJack() {
pAE->setNextBpm( fBpm );
pAE->unlock();

// Give Hydrogen some time to apply the tempo changes. Else, we might
// run into race conditions with relocation being triggered before tempo
// was applied. In such a case we loose the former offsets and won't be
// able to properly check for matching position.
QTest::qSleep( 25 );

AudioEngineTests::checkTransportPosition(
pTransportPos, "[testTransportRelocationOffsetsJack::tempo] mismatch after tempo change" );
}
Expand Down

0 comments on commit 557a16c

Please sign in to comment.