Commit dd21578
AR Abdul Azeez
fix: resolve pre-existing test failures on main
- SDKInitTests: make initWithContext(context, appId) non-blocking by
always dispatching internalInit asynchronously. Update
getServiceWithFeatureGate to properly handle FAILED (throw
initFailureException) and IN_PROGRESS (block until ready) states
instead of only checking isInitialized. Add requireInitForOperation
helper for login/logout to also wait when init is in progress.
- InAppMessagesManagerTests: add suspendifyOnMain mock to IOMockHelper
so fireOnMain callbacks execute synchronously in tests, eliminating
the race condition where verify ran before the spawned thread.
- FeatureManagerTests: add afterEach cleanup for ThreadingMode global
state to prevent CI flakiness from parallel test execution.
Made-with: Cursor1 parent 6103044 commit dd21578
File tree
3 files changed
+48
-28
lines changed- OneSignalSDK/onesignal
- core/src
- main/java/com/onesignal/internal
- test/java/com/onesignal/core/internal/features
- testhelpers/src/main/java/com/onesignal/mocks
3 files changed
+48
-28
lines changedLines changed: 38 additions & 28 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
50 | 50 | | |
51 | 51 | | |
52 | 52 | | |
53 | | - | |
| 53 | + | |
| 54 | + | |
54 | 55 | | |
55 | 56 | | |
56 | 57 | | |
| |||
288 | 289 | | |
289 | 290 | | |
290 | 291 | | |
291 | | - | |
| 292 | + | |
292 | 293 | | |
293 | | - | |
294 | 294 | | |
295 | 295 | | |
296 | 296 | | |
297 | 297 | | |
298 | 298 | | |
299 | 299 | | |
300 | 300 | | |
| 301 | + | |
301 | 302 | | |
302 | 303 | | |
| 304 | + | |
| 305 | + | |
303 | 306 | | |
304 | 307 | | |
305 | 308 | | |
306 | 309 | | |
307 | | - | |
308 | | - | |
309 | | - | |
310 | | - | |
311 | | - | |
312 | | - | |
313 | | - | |
314 | | - | |
315 | | - | |
316 | | - | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
317 | 313 | | |
318 | 314 | | |
| 315 | + | |
319 | 316 | | |
320 | 317 | | |
321 | 318 | | |
| |||
380 | 377 | | |
381 | 378 | | |
382 | 379 | | |
383 | | - | |
384 | | - | |
385 | | - | |
| 380 | + | |
386 | 381 | | |
387 | 382 | | |
388 | 383 | | |
| |||
398 | 393 | | |
399 | 394 | | |
400 | 395 | | |
401 | | - | |
402 | | - | |
403 | | - | |
| 396 | + | |
404 | 397 | | |
405 | 398 | | |
406 | 399 | | |
| |||
417 | 410 | | |
418 | 411 | | |
419 | 412 | | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
420 | 429 | | |
421 | 430 | | |
422 | 431 | | |
| |||
514 | 523 | | |
515 | 524 | | |
516 | 525 | | |
517 | | - | |
518 | | - | |
519 | | - | |
520 | | - | |
521 | | - | |
522 | | - | |
523 | | - | |
524 | | - | |
| 526 | + | |
| 527 | + | |
| 528 | + | |
| 529 | + | |
| 530 | + | |
| 531 | + | |
| 532 | + | |
| 533 | + | |
| 534 | + | |
525 | 535 | | |
526 | 536 | | |
527 | 537 | | |
| |||
626 | 636 | | |
627 | 637 | | |
628 | 638 | | |
| 639 | + | |
629 | 640 | | |
630 | 641 | | |
631 | 642 | | |
632 | | - | |
633 | 643 | | |
634 | 644 | | |
635 | 645 | | |
| |||
Lines changed: 4 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
19 | 23 | | |
20 | 24 | | |
21 | 25 | | |
| |||
Lines changed: 6 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
5 | 6 | | |
6 | 7 | | |
7 | 8 | | |
| |||
114 | 115 | | |
115 | 116 | | |
116 | 117 | | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
117 | 123 | | |
118 | 124 | | |
119 | 125 | | |
| |||
0 commit comments