File tree Expand file tree Collapse file tree 1 file changed +7
-5
lines changed
src/test/java/com/github/copilot/sdk Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -50,14 +50,16 @@ void newSingleThreadExecutorRunsTask() throws Exception {
5050
5151 @ Test
5252 void isVirtualThreadsReturnsBoolean () {
53- // On Java 17 this returns false; on Java 21+ it returns true.
54- // We just verify it doesn't throw.
53+ // Unit tests run against exploded classes rather than the packaged
54+ // multi-release JAR, so Java 21+ may still load the base implementation
55+ // and report false here. Verify only behavior that does not depend on
56+ // multi-release class selection.
5557 boolean result = ThreadFactoryProvider .isVirtualThreads ();
5658 int javaVersion = Runtime .version ().feature ();
57- if (javaVersion >= 21 ) {
58- assertTrue (result , "Expected virtual threads on Java 21+" );
59- } else {
59+ if (javaVersion < 21 ) {
6060 assertFalse (result , "Expected platform threads on Java < 21" );
61+ } else if (result ) {
62+ assertTrue (javaVersion >= 21 , "Virtual threads are only supported on Java 21+" );
6163 }
6264 }
6365}
You can’t perform that action at this time.
0 commit comments