Commit ae8ad83
[WIP] Achieve 100% InProcess and out-of-process test parity (#2272)
Author: Ed Burns <edburns@microsoft.com>
Date: Fri Aug 7 17:29:06 2026 +0000
Fix Java in-process test lifecycle and parity
Prevent the Java in-process test profile from corrupting Surefire control
streams or poisoning later tests through the runtime's process-global LLM
provider registration. Preserve explicit subprocess and TCP transport choices,
sanitize process-only options before constructing in-process clients, and run
request-handler tests over their required isolated stdio runtime.
Fix the remaining test-contract issues by making fake socket RPC handler
registration atomic with reader startup, honoring the configured CLI
entrypoint when runtime.node is in a prebuilds directory, and isolating the
streaming model-cache scenario. Remove in-process skip annotations from tests
that already exercise an explicit subprocess transport.
The complete `mvn clean verify -Pinprocess` run now finishes successfully
without hangs, transport timeouts, provider-ownership failures, or Surefire
stream corruption.
File-by-file manifest:
- `java/sdk/pom.xml`: use Surefire's TCP fork channel for unit and integration
tests so native runtime output cannot corrupt Maven's process-pipe protocol.
- `java/sdk/src/main/java/com/github/copilot/CopilotClient.java`: preserve
explicitly selected TCP options when the default connection environment
requests in-process transport.
- `java/sdk/src/main/java/com/github/copilot/JsonRpcClient.java`: add a socket
construction hook that registers handlers before the reader thread starts.
- `java/sdk/src/main/java/com/github/copilot/ffi/NativeRuntimeLoader.java`:
resolve the configured Copilot executable separately from runtime.node when
the native library uses the package's prebuilds layout.
- `java/sdk/src/main/java/com/github/copilot/rpc/CopilotClientOptions.java`:
allow `setCwd(null)` to clear a previously configured working directory.
- `java/sdk/src/test/java/com/github/copilot/ClientOptionsE2ETest.java`: run
explicit fake-stdio option forwarding tests under the in-process profile.
- `java/sdk/src/test/java/com/github/copilot/ConfigCloneTest.java`: cover
clearing a configured working directory.
- `java/sdk/src/test/java/com/github/copilot/CopilotClientTest.java`: remove
obsolete in-process skips from explicit subprocess and TCP lifecycle tests.
- `java/sdk/src/test/java/com/github/copilot/CopilotClientTransportTest.java`:
test explicit transport precedence, in-process option sanitization, and TCP
token selection under the profile default.
- `java/sdk/src/test/java/com/github/copilot/CopilotRequestTestSupport.java`:
explicitly select stdio for request-handler tests that register the
process-global LLM inference provider.
- `java/sdk/src/test/java/com/github/copilot/E2ETestContext.java`: honor
explicit transports, route request-handler clients to subprocess isolation,
and clear environment, cwd, and CLI arguments before in-process client
construction.
- `java/sdk/src/test/java/com/github/copilot/GitHubTelemetryTest.java`: register
fake runtime RPC handlers before socket message processing begins.
- `java/sdk/src/test/java/com/github/copilot/MetadataApiTest.java`: run explicit
stdio metadata tests instead of skipping them under the profile.
- `java/sdk/src/test/java/com/github/copilot/PerSessionAuthTest.java`: run the
explicit subprocess unauthenticated case under the profile.
- `java/sdk/src/test/java/com/github/copilot/RpcServerMiscE2ETest.java`: run the
explicit subprocess account lifecycle case under the profile.
- `java/sdk/src/test/java/com/github/copilot/StreamingFidelityTest.java`: give
the gpt-5.4 reasoning/streaming scenario an isolated proxy and runtime model
cache.
- `java/sdk/src/test/java/com/github/copilot/ffi/FfiRuntimeHostTest.java`: cover
failed connection-open cleanup followed by successful sequential startup.
- `java/sdk/src/test/java/com/github/copilot/ffi/NativeRuntimeLoaderTest.java`:
cover resolving a configured CLI beside a prebuilds runtime.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: e03c4e94-97b0-41ad-9f4e-c01633dc0bf71 parent 181da0a commit ae8ad83
28 files changed
Lines changed: 1409 additions & 99 deletions
File tree
- 1917-java-embed-rust-cli-runtime-remove-before-merge
- spike-post-agentic-01-test-parity-validate-callback-flow-with-real-runtime_node
- src/main/java/com/github/copilot/spike
- java
- copilot-native/scripts
- sdk
- src
- main/java/com/github/copilot
- ffi
- rpc
- test/java/com/github/copilot
- e2e
- ffi
Lines changed: 3 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
135 | 135 | | |
136 | 136 | | |
137 | 137 | | |
138 | | - | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
139 | 141 | | |
140 | 142 | | |
141 | 143 | | |
| |||
Lines changed: 172 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
Lines changed: 125 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
0 commit comments