Commit 2159229
committed
test: fix flaky concurrent test in cab token generator
The refreshCredentialsIfRequired_asyncMultiThread test was failing because the mock clock was returning a fixed stale time, causing multiple threads to trigger redundant refreshes if they didn't overlap perfectly.
This change modifies the mock clock to return a stale time on the first call (to trigger the async refresh) and a fresh time on subsequent calls (to skip redundant refreshes). This fix is isolated to only the ASYNC test case to avoid breaking BLOCKING tests.1 parent acab557 commit 2159229
1 file changed
Lines changed: 9 additions & 1 deletion
File tree
- google-auth-library-java/cab-token-generator/javatests/com/google/auth/credentialaccessboundary
Lines changed: 9 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
614 | 614 | | |
615 | 615 | | |
616 | 616 | | |
| 617 | + | |
617 | 618 | | |
618 | 619 | | |
619 | 620 | | |
620 | 621 | | |
621 | 622 | | |
| 623 | + | |
| 624 | + | |
| 625 | + | |
| 626 | + | |
| 627 | + | |
622 | 628 | | |
623 | 629 | | |
624 | 630 | | |
625 | 631 | | |
626 | 632 | | |
| 633 | + | |
627 | 634 | | |
628 | 635 | | |
629 | 636 | | |
630 | 637 | | |
631 | 638 | | |
632 | | - | |
| 639 | + | |
| 640 | + | |
633 | 641 | | |
634 | 642 | | |
635 | 643 | | |
| |||
0 commit comments