@@ -148,7 +148,7 @@ public void onSDKInitialized() {
148148 });
149149
150150 assertTrue ("Initialization with config should complete" ,
151- waitForAsyncInitialization (initLatch , 3 ));
151+ waitForAsyncInitialization (initLatch , 5 ));
152152 }
153153
154154 // ========================================
@@ -179,7 +179,7 @@ public void onSDKInitialized() {
179179 assertTrue ("Operations should be queued" , IterableBackgroundInitializer .getQueuedOperationCount () > 0 );
180180
181181 // Wait for initialization to complete
182- assertTrue ("Initialization should complete" , waitForAsyncInitialization (initLatch , 3 ));
182+ assertTrue ("Initialization should complete" , waitForAsyncInitialization (initLatch , 5 ));
183183
184184 // Process queue
185185 ShadowLooper .runUiThreadTasksIncludingDelayedTasks ();
@@ -216,7 +216,7 @@ public void onSDKInitialized() {
216216 // These SHOULD be queued
217217 assertTrue ("Operations during init should be queued" , IterableBackgroundInitializer .getQueuedOperationCount () > 0 );
218218
219- assertTrue ("Initialization should complete" , waitForAsyncInitialization (initLatch , 3 ));
219+ assertTrue ("Initialization should complete" , waitForAsyncInitialization (initLatch , 5 ));
220220 }
221221
222222 @ Test
@@ -241,7 +241,7 @@ public void onSDKInitialized() {
241241 numOperations , IterableBackgroundInitializer .getQueuedOperationCount ());
242242
243243 // Wait for completion and processing
244- assertTrue ("Initialization should complete" , waitForAsyncInitialization (initLatch , 3 ));
244+ assertTrue ("Initialization should complete" , waitForAsyncInitialization (initLatch , 5 ));
245245
246246 // Process queue
247247 ShadowLooper .runUiThreadTasksIncludingDelayedTasks ();
@@ -291,7 +291,7 @@ public void onSDKInitialized() {
291291
292292 });
293293
294- assertTrue ("Success callback should be called" , waitForAsyncInitialization (successLatch , 3 ));
294+ assertTrue ("Success callback should be called" , waitForAsyncInitialization (successLatch , 5 ));
295295 assertTrue ("Callback should execute on main thread" , callbackExecutedOnMainThread .get ());
296296 }
297297
@@ -326,7 +326,7 @@ public void onSDKInitialized() {
326326
327327 ShadowLooper .runUiThreadTasksIncludingDelayedTasks ();
328328 assertTrue ("Callback should be called despite exception" ,
329- waitForAsyncInitialization (callbackLatch , 3 ));
329+ waitForAsyncInitialization (callbackLatch , 5 ));
330330
331331 // System should still be in a valid state
332332 assertFalse ("Should not be initializing after completion despite callback exception" ,
@@ -366,7 +366,7 @@ public void onSDKInitialized() {
366366
367367 startLatch .countDown ();
368368
369- assertTrue ("All threads should complete" , waitForAsyncInitialization (completeLatch , 3 ));
369+ assertTrue ("All threads should complete" , waitForAsyncInitialization (completeLatch , 5 ));
370370
371371 // All threads should get success callbacks (concurrent calls should all be notified when init completes)
372372 assertEquals ("All threads should get success callbacks" , numThreads , successCount .get ());
@@ -448,7 +448,7 @@ public void onSDKInitialized() {
448448 // During initialization - should not be considered fully initialized yet
449449 assertFalse ("Should not be fully initialized during background init" , IterableApi .isSDKInitialized ());
450450
451- assertTrue ("Initialization should complete" , waitForAsyncInitialization (initLatch , 3 ));
451+ assertTrue ("Initialization should complete" , waitForAsyncInitialization (initLatch , 5 ));
452452
453453 // After initialization completes but before setting user - still not fully initialized
454454 assertFalse ("Should not be fully initialized without user identification" , IterableApi .isSDKInitialized ());
@@ -489,7 +489,7 @@ public void onSDKInitialized() {
489489
490490 });
491491
492- assertTrue ("Initialization should complete" , waitForAsyncInitialization (initLatch , 3 ));
492+ assertTrue ("Initialization should complete" , waitForAsyncInitialization (initLatch , 5 ));
493493
494494 assertFalse ("Should not be initializing after completion" , IterableApi .isSDKInitializing ());
495495 }
@@ -518,7 +518,7 @@ public void onSDKInitialized() {
518518 });
519519
520520 // First should complete
521- assertTrue ("First initialization should complete" , waitForAsyncInitialization (firstInitLatch , 3 ));
521+ assertTrue ("First initialization should complete" , waitForAsyncInitialization (firstInitLatch , 5 ));
522522
523523 // Second should also complete (called immediately since first is done)
524524 assertTrue ("Second initialization should also complete" , waitForAsyncInitialization (secondInitLatch , 5 ));
@@ -842,7 +842,7 @@ public void onSDKInitialized() {
842842 }
843843 });
844844
845- assertTrue ("Success callback should be called even with null context" , waitForAsyncInitialization (completionLatch , 3 ));
845+ assertTrue ("Success callback should be called even with null context" , waitForAsyncInitialization (completionLatch , 5 ));
846846 assertEquals ("Queue should remain empty" , 0 , IterableBackgroundInitializer .getQueuedOperationCount ());
847847 }
848848
@@ -858,7 +858,7 @@ public void onSDKInitialized() {
858858
859859 });
860860
861- assertTrue ("Should handle empty API key" , waitForAsyncInitialization (completionLatch , 3 ));
861+ assertTrue ("Should handle empty API key" , waitForAsyncInitialization (completionLatch , 5 ));
862862 }
863863
864864 @ Test
@@ -874,7 +874,7 @@ public void onSDKInitialized() {
874874
875875 });
876876
877- assertTrue ("Should handle very long API key" , waitForAsyncInitialization (completionLatch , 3 ));
877+ assertTrue ("Should handle very long API key" , waitForAsyncInitialization (completionLatch , 5 ));
878878 }
879879
880880 @ Test
@@ -892,7 +892,7 @@ public void testOnSDKInitialized_CallbackExecutedOnMainThread() throws Interrupt
892892 IterableApi .initialize (context , TEST_API_KEY );
893893
894894 // Wait for callback
895- boolean callbackCalled = waitForAsyncInitialization (callbackLatch , 3 );
895+ boolean callbackCalled = waitForAsyncInitialization (callbackLatch , 5 );
896896
897897 assertTrue ("onSDKInitialized callback should be called" , callbackCalled );
898898 assertTrue ("onSDKInitialized callback should be executed on main thread" , callbackExecutedOnMainThread .get ());
@@ -940,7 +940,7 @@ public void testOnSDKInitialized_MultipleCallbacks() throws InterruptedException
940940 IterableApi .initialize (context , TEST_API_KEY );
941941
942942 // Wait for all callbacks
943- boolean allCallbacksCalled = waitForAsyncInitialization (callbackLatch , 3 );
943+ boolean allCallbacksCalled = waitForAsyncInitialization (callbackLatch , 5 );
944944
945945 assertTrue ("All onSDKInitialized callbacks should be called" , allCallbacksCalled );
946946 assertEquals ("All callbacks should be executed on main thread" , 3 , mainThreadCallbackCount .get ());
@@ -1002,8 +1002,8 @@ public void testOnSDKInitialized_ExceptionInCallback() throws InterruptedExcepti
10021002 IterableApi .initialize (context , TEST_API_KEY );
10031003
10041004 // Wait for both callbacks
1005- boolean callback1CalledResult = waitForAsyncInitialization (callback1Latch , 3 );
1006- boolean callback2CalledResult = waitForAsyncInitialization (callback2Latch , 3 );
1005+ boolean callback1CalledResult = waitForAsyncInitialization (callback1Latch , 5 );
1006+ boolean callback2CalledResult = waitForAsyncInitialization (callback2Latch , 5 );
10071007
10081008 assertTrue ("First callback should be called even though it throws" , callback1CalledResult );
10091009 assertTrue ("Second callback should be called despite first callback throwing" , callback2CalledResult );
@@ -1243,7 +1243,7 @@ public void onSDKInitialized() {
12431243 assertTrue ("Should have queued operations during init" , queuedOps > 0 );
12441244
12451245 // Wait for initialization to complete
1246- assertTrue ("Initialization should complete" , waitForAsyncInitialization (initLatch , 3 ));
1246+ assertTrue ("Initialization should complete" , waitForAsyncInitialization (initLatch , 5 ));
12471247
12481248 // After init, queue should be processed and inner method should have been called
12491249 Thread .sleep (200 );
@@ -1272,7 +1272,7 @@ public void onSDKInitialized() {
12721272 }
12731273 });
12741274
1275- assertTrue ("Initialization should complete" , waitForAsyncInitialization (initLatch , 3 ));
1275+ assertTrue ("Initialization should complete" , waitForAsyncInitialization (initLatch , 5 ));
12761276
12771277 // Now call overloaded methods after initialization
12781278 // setEmail(email) internally calls setEmail(email, null, null, null, null)
@@ -1344,7 +1344,7 @@ public void onSDKInitialized() {
13441344 assertEquals ("Should only queue outer operation, not nested calls" , 1 , queuedOps );
13451345
13461346 // Wait for initialization
1347- assertTrue ("Initialization should complete" , waitForAsyncInitialization (initLatch , 3 ));
1347+ assertTrue ("Initialization should complete" , waitForAsyncInitialization (initLatch , 5 ));
13481348
13491349 // Wait for queue processing
13501350 Thread .sleep (200 );
@@ -1407,7 +1407,7 @@ public void onSDKInitialized() {
14071407 assertEquals ("Full overload should not be called during queuing" , 0 , fullOverloadCallCount .get ());
14081408
14091409 // Wait for initialization
1410- assertTrue ("Initialization should complete" , waitForAsyncInitialization (initLatch , 3 ));
1410+ assertTrue ("Initialization should complete" , waitForAsyncInitialization (initLatch , 5 ));
14111411
14121412 // Wait for queue to process
14131413 Thread .sleep (300 );
@@ -1459,7 +1459,7 @@ public void onSDKInitialized() {
14591459 assertTrue ("Operations should be queued during background init" , IterableBackgroundInitializer .getQueuedOperationCount () > 0 );
14601460
14611461 // Wait for init to complete
1462- assertTrue ("Background init should complete" , waitForAsyncInitialization (initLatch , 3 ));
1462+ assertTrue ("Background init should complete" , waitForAsyncInitialization (initLatch , 5 ));
14631463
14641464 // After init completes, new operations should execute immediately
14651465 Thread .sleep (200 );
0 commit comments