File tree Expand file tree Collapse file tree 2 files changed +13
-7
lines changed
algoliasearch-tests/src/test/java/com/algolia/search/integration/common Expand file tree Collapse file tree 2 files changed +13
-7
lines changed Original file line number Diff line number Diff line change @@ -64,10 +64,13 @@ public void createModifyAndDeleteABTests() throws Exception {
6464
6565 waitForCompletion (analytics .addABTest (abtest ));
6666
67- abTests = analytics .getABTests (0 , 10 ).get ();
68- assertThat (abTests .getCount ()).isEqualTo (1 );
69- assertThat (abTests .getTotal ()).isEqualTo (1 );
70- assertThat (abTests .getAbtests ()).hasSize (1 );
67+ Boolean found = false ;
68+ while (!found ) {
69+ abTests = analytics .getABTests (0 , 10 ).get ();
70+ found =
71+ abTests .getCount () == 1 && abTests .getTotal () == 1 && abTests .getAbtests ().size () == 1 ;
72+ Thread .sleep (1000 );
73+ }
7174
7275 ABTest inserted = abTests .getAbtests ().get (0 );
7376 ABTestingHelpersTest .compareABTests (abtest , inserted );
Original file line number Diff line number Diff line change 2222public abstract class SyncABTestingTest extends SyncAlgoliaIntegrationTest {
2323
2424 @ Test
25- public void createModifyAndDeleteABTests () throws AlgoliaException {
25+ public void createModifyAndDeleteABTests () throws AlgoliaException , InterruptedException {
2626 Analytics analytics = createAnalytics ();
2727 int offset = 0 ;
2828 int limit = 10 ;
@@ -77,7 +77,10 @@ public void createModifyAndDeleteABTests() throws AlgoliaException {
7777 assertThat (inserted .getStatus ()).isEqualTo ("stopped" );
7878
7979 waitForCompletion (analytics .deleteABTest (inserted .getAbTestID ()));
80- abTests = analytics .getABTests (0 , 10 );
81- assertThat (abTests .getCount ()).isEqualTo (0 );
80+ Boolean isEmpty = false ;
81+ while (!isEmpty ) {
82+ isEmpty = analytics .getABTests (0 , 10 ).getCount () == 0 ;
83+ Thread .sleep (1000 );
84+ }
8285 }
8386}
You can’t perform that action at this time.
0 commit comments