Skip to content
Snippets Groups Projects
Commit 862ceb54 authored by Hugo Beauzée-Luyssen's avatar Hugo Beauzée-Luyssen
Browse files

unittest: RemovalNotifier: Allow batches to be segmented


This can happen on slow machines

(cherry picked from commit eae2551b)
Signed-off-by: default avatarHugo Beauzée-Luyssen <hugo@beauzee.fr>
parent 1170e056
No related branches found
No related tags found
No related merge requests found
...@@ -145,11 +145,19 @@ TEST_F( ModificationsNotifierTests, DeleteBatch ) ...@@ -145,11 +145,19 @@ TEST_F( ModificationsNotifierTests, DeleteBatch )
// This media doesn't have any associated files, and should be removed by a sqlite hook // This media doesn't have any associated files, and should be removed by a sqlite hook
// The notification will arrive "late", as it will need to timeout first // The notification will arrive "late", as it will need to timeout first
auto res = cbMock->waitForNotif( lock, uint32_t nbTotalNotified = 0;
std::chrono::duration_cast<std::chrono::seconds>( std::chrono::milliseconds{ 1500 } ), while ( nbTotalNotified != 10 )
hasTimedout ); {
ASSERT_FALSE( hasTimedout ); auto nbNotified = cbMock->waitForNotif( lock,
ASSERT_EQ( 10u, res ); std::chrono::duration_cast<std::chrono::seconds>( std::chrono::milliseconds{ 1500 } ),
hasTimedout );
ASSERT_NE( 0u, nbNotified );
ASSERT_FALSE( hasTimedout );
ASSERT_TRUE( nbNotified != 1 || nbNotified + nbTotalNotified == 10 );
nbTotalNotified += nbNotified;
cbMock->resetCount();
}
ASSERT_EQ( 10u, nbTotalNotified );
} }
TEST_F( ModificationsNotifierTests, Flush ) TEST_F( ModificationsNotifierTests, Flush )
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment