Commit Graph

10 Commits

Author SHA1 Message Date
bitloi 3de8704bd3 WorkerMain: exit quietly on invalid JSON-RPC input (no stack trace)
When input lacks 'jsonrpc' field (e.g. {}), call System.exit(1) instead
of throwing IllegalArgumentException. Avoids noisy stack traces in
CI from WorkerExchangeTest's intentional bad-input tests.
2026-02-01 02:33:41 +01:00
eugene yokota 215e9d6325
[2.x] fix: Prevent fork test cross talk (#8575)
**Problem**
currently all notifications go to all listeners.

**Solution**
This adds "re" field so we can check if it matches with the id.
2026-01-19 00:55:16 -05:00
MkDev11 061145e67b
[2.x] Add testForkedParallelism setting for forked test thread count (#8453)
**Problems**

When running forked tests, sbt uses `Runtime.getRuntime().availableProcessors()` to determine the thread pool size, ignoring `concurrentRestrictions`. This is inconsistent with non-forked parallel tests.

**Expectations**

Users should be able to control the number of parallel test threads in forked mode, similar to how `concurrentRestrictions` works for non-forked tests.

**Notes**

Added a new setting `testForkedParallelism` that allows explicit control:

```scala
testForkedParallelism := Some(2)  // Use 2 threads
testForkedParallelism := None     // Use availableProcessors() (default)
```
2026-01-09 12:43:50 -05:00
Eugene Yokota c20d83a8e2 Use TCP for the fork test
**Problem**
Forked test currently uses stdio, but that println to be lost.

**Solution**
Use TCP for communication similar to sbt 1.x.
2026-01-04 01:48:45 -05:00
Eugene Yokota 9888aae7fa [2.x] Switch to using shaded-gson
Fixes https://github.com/sbt/sbt/issues/8334
2025-12-15 03:17:33 -05:00
Anatolii Kmetiuk 862884b330 Fix #8345: forked test execution doesn't access main resources
Fixes issue where tests running in forked mode (Test / fork := true)
cannot access resources from src/main/resources, while non-forked
execution works correctly.

Root cause: Context classloader not set: tests using
Thread.currentThread().getContextClassLoader() couldn't find
resources because the context classloader wasn't set to the
URLClassLoader with the classpath

Solution: Set context classloader in ForkTestMain.runTests() to the
URLClassLoader containing the test classpath
2025-12-08 14:17:09 +09:00
Eugene Yokota 8a9f24b395 fix: Fixes forked test error handling on JDK 17
**Problem**
Forked tests apparently incorrectly returns success if an exception is thrown
on JDK 17 and up, due to exception failing to persist.

**Solution**
This adds custom codec for Throwable to workaround this issue.
2025-09-07 04:44:05 -04:00
xuwei-k ee10ff7e23 use try-with-resources syntax in WorkerMain.java 2025-09-07 12:50:11 +09:00
Eugene Yokota b247e2620f Reimplement test agent as a worker command
This sends JSON-RPC over stdin as opposed to using ObjectStream over socket.
2025-07-04 01:28:56 -04:00
Eugene Yokota eb74554ec1 Worker
This implements plain run for worker for testing.
2025-06-30 02:44:36 -04:00