Commit 0a40114
committed
Fix macOS-flaky tests: testShouldGetLastSessionId and testShouldGetSessionMetadataById
The Copilot CLI persists session state asynchronously, so querying
session metadata or the last session ID immediately after sendAndWait()
is a race condition. On Linux (CI) and Windows the I/O completes fast
enough to mask the issue, but on macOS the tests fail consistently.
Align the Java tests with the .NET and Node.js reference implementations:
- testShouldGetLastSessionId: close the session before calling
getLastSessionId() (matches .NET DisposeAsync-then-query pattern),
and poll with a 10-second deadline and 50ms intervals (matches
Node.js client_lifecycle.e2e.test.ts polling pattern).
- testShouldGetSessionMetadataById: poll getSessionMetadata() with a
10-second deadline and 50ms intervals until it returns non-null
(matches .NET WaitForConditionAsync pattern).
Signed-off-by: Ed Burns <edburns@microsoft.com>1 parent a4af255 commit 0a40114
1 file changed
Lines changed: 31 additions & 7 deletions
Lines changed: 31 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
760 | 760 | | |
761 | 761 | | |
762 | 762 | | |
| 763 | + | |
| 764 | + | |
763 | 765 | | |
764 | | - | |
| 766 | + | |
| 767 | + | |
| 768 | + | |
| 769 | + | |
| 770 | + | |
| 771 | + | |
| 772 | + | |
| 773 | + | |
| 774 | + | |
| 775 | + | |
| 776 | + | |
| 777 | + | |
765 | 778 | | |
766 | | - | |
767 | | - | |
768 | | - | |
| 779 | + | |
769 | 780 | | |
770 | 781 | | |
771 | 782 | | |
| |||
840 | 851 | | |
841 | 852 | | |
842 | 853 | | |
| 854 | + | |
843 | 855 | | |
844 | 856 | | |
845 | | - | |
846 | | - | |
847 | | - | |
| 857 | + | |
| 858 | + | |
| 859 | + | |
| 860 | + | |
| 861 | + | |
| 862 | + | |
| 863 | + | |
| 864 | + | |
| 865 | + | |
| 866 | + | |
| 867 | + | |
| 868 | + | |
| 869 | + | |
| 870 | + | |
| 871 | + | |
848 | 872 | | |
849 | 873 | | |
850 | 874 | | |
| |||
0 commit comments