C#: Pass classpath via environment variable instead of -cp argument#7345
Merged
C#: Pass classpath via environment variable instead of -cp argument#7345
Conversation
Avoids command-line length limits on Windows by setting the CLASSPATH environment variable instead of passing it as a -cp argument to the Java RPC test server process.
PreconditionsCheckTest expects LocalUsesType (local fallback) but when RPC tests run first, RewriteRpcServer.Current is non-null, causing UsesType to return an RpcVisitor that fails silently. Save/restore the static in the test fixture to ensure isolation.
…ava via RPC
UsesType/UsesMethod now require an RPC connection and delegate to Java's
HasType/HasMethod. This eliminates the static state leak that caused flaky
test failures — tests using preconditions are inherently RPC-bound and must
run sequentially via RpcRewriteTest/[Collection("RPC")].
Also fix rpcTestClasspath to include processResources output directories so
Java's ServiceLoader discovers CSharpRpcCodec when the C# test fixture
spawns a Java RPC process.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
CLASSPATHenvironment variable instead of the-cpcommand-line argument when launching the RPC test server processTest plan
dotnet testfromrewrite-csharp/csharp/)