[2.x] fix: Adjust the forked test classpath (#9170)

**Problem**
We can't test WorkerMain using forked test.

**Solution**
Allow WorkerMain to be shadowed.
This commit is contained in:
eugene yokota 2026-05-03 02:36:00 -04:00 committed by Eugene Yokota
parent 532edd1716
commit 97299f1ff9
1 changed files with 3 additions and 2 deletions

View File

@ -35,11 +35,12 @@ object WorkerExchange:
extraCp: Seq[File],
connectionType: WorkerConnection,
): WorkerProxy =
val fullCp = Seq(
// put extraCp first so we can shadow the WorkerMain class
val fullCp = extraCp ++ Seq(
IO.classLocationPath(classOf[WorkerMain]).toFile,
IO.classLocationPath(classOf[Framework]).toFile,
IO.classLocationPath(classOf[Gson]).toFile,
) ++ extraCp
)
val inputRef = Promise[OutputStream]()
val socketOpt = connectionType match
case WorkerConnection.Tcp =>