Skip to content

[Build] Add dev/run-tests.py to run tests in parallel JVMs - #2160

Merged
yili-db merged 4 commits into
unitycatalog:mainfrom
yili-db:stack/run_test_parallel
Nov 12, 2026
Merged

yili-db merged 4 commits into
unitycatalog:mainfrom
yili-db:stack/run_test_parallel

Conversation

@yili-db

@yili-db yili-db commented Nov 9, 2026 •

Copy link
Copy Markdown
Collaborator

🥞 Stacked PR

Use this link to review incremental changes.


  • Add project/TestParallelization.scala, enabled only by TEST_PARALLELISM
    • Splits each project's suites into forked JVMs, longest first by recorded durations
    • Lifts sbt's default limit of one forked test JVM at a time across the build, keeping sbt-assembly's own limit
    • Fails to load the build if TEST_PARALLELISM is not a positive integer
  • Add dev/run-tests.py, running the same tests as build/sbt test
    • Picks the JVM count from the CPUs it may use and the available memory, capped by its cgroup memory limits, not counting reclaimable page cache as used
    • Rejects a -p below 1 and heap sizes without a unit; passes -J-Xms with -J-Xmx so a small --sbt-heap still starts sbt
    • Logs to target/test-logs/; the root project's cleanKeepFiles keeps the log and suite durations across every clean, not only in parallel runs
    • Prints a failure summary with each failure's message, reports test JVMs that exited early, shows sbt's errors when it fails before any test runs, and warns if tests write etc/conf
    • Stops sbt and its test JVMs if the script fails or gets Ctrl-C
  • Add project/tests/test_run_tests.py, run in the "Build Test" CI job
    • Checks argument validation, the failure summary, the cgroup memory math, the durations file and the forked test JVM limit
    • Runs dev/run-tests.py -p 2 clean client/test end to end, asserting both client test groups get suites
  • Make the script the preferred way to run tests in AGENTS.md and README.md
    • Clarify that -J-Xmx sets sbt's own heap, not the forked test JVMs'
  • Full suite on a 32-core machine: 3.5-5.5 min, versus 26 min with build/sbt test

Signed-off-by: Yi Li [email protected]

PR Checklist

  • A description of the changes is added to the description of this PR.
  • If there is a related issue, make sure it is linked to this PR.
  • If you've fixed a bug or added code that should be tested, add tests!
  • If you've added or modified a feature, documentation in docs is updated

Description of changes

This pull request and its description were written by Isaac.

@yili-db
yili-db marked this pull request as ready for review November 9, 2026 22:23
@yili-db

yili-db commented Nov 9, 2026

Copy link
Copy Markdown
Collaborator Author

/review

Comment thread dev/run-tests.py Outdated
env = dict(
os.environ, TEST_PARALLELISM=str(args.parallelism), TEST_JVM_HEAP=args.jvm_heap,
TEST_DURATIONS_FILE=DURATIONS_FILE)
cmd = [os.path.join(ROOT, "build", "sbt"), f"-J-Xmx{args.sbt_heap}"] + args.commands

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

--sbt-heap 512m sets the maximum heap to 512 MiB but leaves the launcher’s initial heap at 1000 MiB.

         TEST_DURATIONS_FILE=DURATIONS_FILE)
-    cmd = [os.path.join(ROOT, "build", "sbt"), f"-J-Xmx{args.sbt_heap}"] + args.commands
+    cmd = [os.path.join(ROOT, "build", "sbt"),
+           f"-J-Xms{args.sbt_heap}", f"-J-Xmx{args.sbt_heap}"] + args.commands
     print(f"Running {' '.join(cmd[1:])} with {args.parallelism} test JVMs")

Comment thread dev/run-tests.py Outdated

if not args.verbose:
threading.Thread(target=report_progress, daemon=True).start()
with open(log_path, "w") as log:

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(ai assisted) On Linux, dev/run-tests.py clean test opens the log, then sbt’s clean removes it from target. Python continues writing to a file that no longer has a path. Preserve the log directory during cleaning. Add this setting to the root project in build.sbt:

--- a/build.sbt
+++ b/build.sbt
@@ -906,2 +906,3 @@
     commonSettings,
+    cleanKeepFiles += target.value / "test-logs",
     rootReleaseSettings

(personal comment) i thought writing to a file that doesnt exist will create the file? please have a deeper look

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[AI Assisted] I checked, and it does not recreate it. Once clean deletes the open log, the script's writes go to the unlinked inode, which has no path, and the content is gone when the file is closed. On a real dev/run-tests.py -p 2 clean client/test, the printed "Full log:" path did not exist after the run. It also replaced target/test-durations.csv with only that run's suites: clean keeps target/ itself but deletes its contents, so the durations write did not fail, it just lost the history.

Added cleanKeepFiles for test-logs and test-durations.csv on the root project, as you suggested. With it, both survive clean. The durations write now also creates its directory if needed and only warns on failure, so it cannot mask the sbt exit code. project/tests/test_run_tests.py runs clean client/test and fails if the log is missing afterwards.

Comment on lines +41 to +43
Test / testGrouping := {
val tests = (Test / definedTests).value
val forkOpts = (Test / forkOptions).value

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No existing test enables TEST_PARALLELISM or exercises the Python runner. Existing CI runs use the normal sbt path.

@yili-db
yili-db force-pushed the stack/run_test_parallel branch from f061c99 to 911c4fc Compare November 9, 2026 23:35
@yili-db
yili-db requested a review from timothyw553 November 10, 2026 02:16

@shba24 shba24 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks Yi, this is a big speedup, and #2159 underneath it makes the parallel run safe.

Nothing here blocks. The first comment (a dead test JVM disappearing from the summary) is the one I'd most like to see addressed; the test comments would lock in the two things the script exists for. I checked each point with a local run at e1ae662: the halt repro, removing globalSettings and the cleanKeepFiles entry, and show Global / concurrentRestrictions with and without TEST_PARALLELISM.

Comment thread dev/run-tests.py Outdated
for failure in failed:
print(f" {failure}")
print(f"Full output and stack traces: {log_path}, and each module's target/test-reports/")
if returncode != 0 and not failed:

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When a test JVM dies mid-run (OOM kill, System.exit, a crash), the summary loses it. I reproduced it locally with one client test that calls Runtime.getRuntime().halt(137) and another that fails an assertion, then ran dev/run-tests.py -p 2 client/test:

8 suites, 82 tests, 1 failed, wall time 0m39s
...
Failed tests:
  io.unitycatalog.client.ZzFailReproTest#realFailure(): ...
  • The killed JVM's suites (the halting one and the rest of its group) leave no XML, so they're missing from the counts.
  • sbt's [error] \tRunning java with options ... sbt.ForkMain ... failed with exit code 137 line goes only to the log: STREAMED matches Error during tests: but not the indented line under it.
  • Because another suite failed, this if skips the "sbt exited with code" line, so nothing in the console says a JVM died. The script still exits 1, which is good.

With parallelism making OOM kills more likely, how about counting dead JVMs while streaming, and always printing the exit code when it's non-zero? Something like:

JVM_DIED = re.compile(r"sbt\.ForkMain \d+ failed with exit code (\d+)")
...
        for line in proc.stdout:
            ...
            died = JVM_DIED.search(line)
            if died:
                dead_jvms.append(died.group(1))
...
    if dead_jvms:
        print(f"{len(dead_jvms)} test JVM(s) exited early (exit code {', '.join(dead_jvms)}); "
              "their remaining suites did not run. Exit code 137 usually means out of memory: "
              "lower -p or --jvm-heap.")
    if returncode != 0:
        print(f"sbt exited with code {returncode}; see the log for details")

Comment thread project/tests/test_run_tests.py Outdated

log = Path(re.search(r"Full log: (\S+)", output).group(1))
assert log.is_file(), f"the log is missing after the run: {log}"
assert re.search(r"unitycatalog-client: \d+ suites in 2 test JVMs", log.read_text()), (

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This checks the split into 2 groups but not that they run at the same time. I commented out TestParallelization.globalSettings in build.sbt (sbt then resolves Limit forked-test-group to 1) and this test still passed. How about also asserting the restriction itself, which is cheap and deterministic?

    restrictions = subprocess.run(
        [str(UC_ROOT / "build" / "sbt"), "show Global / concurrentRestrictions"],
        cwd=UC_ROOT, env={**os.environ, "TEST_PARALLELISM": "2"},
        capture_output=True, text=True, check=True).stdout
    assert "Limit forked-test-group to 2" in restrictions, restrictions

assert re.search(r"unitycatalog-client: \d+ suites in 2 test JVMs", log.read_text()), (
f"the client suites were not split across 2 test JVMs; see {log}")
summary = re.search(r"(\d+) suites, (\d+) tests, (\d+) failed", output)
assert summary and int(summary.group(1)) > 1 and summary.group(3) == "0", output

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only the passing path is exercised here, so a change that loses the failure list or the non-zero exit would still pass. Since AGENTS.md now points agents at the script, that's the part they rely on. A cheap check without sbt, as a sibling of check_failure_description, would cover the summary:

def check_failure_summary(run_tests) -> None:
    failure = "a.B#t(): boom (at a.B.t(B.java:7))"
    out = io.StringIO()
    with contextlib.redirect_stdout(out):
        run_tests.print_summary([("a.B", 1.0, 2, [failure])], 0, 1, "/tmp/x.log")
    assert "1 failed" in out.getvalue() and failure in out.getvalue(), out.getvalue()

Comment thread project/tests/test_run_tests.py Outdated
summary = re.search(r"(\d+) suites, (\d+) tests, (\d+) failed", output)
assert summary and int(summary.group(1)) > 1 and summary.group(3) == "0", output
durations = UC_ROOT / "target" / "test-durations.csv"
assert "io.unitycatalog.client." in durations.read_text(), f"no client suites in {durations}"

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit (not a blocker): the comment above says clean is there to check the durations file survives it, but update_durations() rewrites the file after sbt exits, so this passes either way. I dropped test-durations.csv from cleanKeepFiles and the test still passed. If that's worth pinning, recording the file's rows before the run and asserting a pre-existing non-client row is still there afterwards would catch it, for example by seeding a row such as zz.Seed,1.0 first. Otherwise, how about trimming the comment to just the log? Feel free to take or skip.

Comment thread project/TestParallelization.scala Outdated
}

lazy val globalSettings: Seq[Setting[_]] = parallelism.toSeq.map { maxJvms =>
// Replaces sbt's default rules, which allow a single forked test group at a time.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit (not a blocker): := also replaces rules added by plugins, not just sbt's defaults. With TEST_PARALLELISM set, show Global / concurrentRestrictions loses sbt-assembly's Limit assembly to 1:

unset:              Limit all to 32, Limit forked-test-group to 1, <Clean>, Limit assembly to 1
TEST_PARALLELISM=2: Limit all to 32, Limit forked-test-group to 2, <Clean>

No effect today, since test only runs serverShaded / assembly, but how about keeping it explicitly?

      Tags.exclusiveGroup(Tags.Clean),
      // Also replaced by this list: sbt-assembly's own limit.
      Tags.limit(sbtassembly.Assembly.assemblyTag, 1))

Comment thread dev/run-tests.py
DURATIONS_FILE = os.path.join(ROOT, "target", "test-durations.csv")
LOG_DIR = os.path.join(ROOT, "target", "test-logs")
SUITE_FINISHED = re.compile(r"Test run finished: (\d+) failed")
# sbt's own result lines; forked JVM stderr is also logged as [error], so match narrowly.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit (not a blocker): this comment describes STREAMED (line 49) but sits above HEAP_SIZE. How about moving it down to STREAMED? While here, HEAP_SIZE also accepts a bare number: --jvm-heap 512 passes and becomes -Xmx512 (bytes), and the JVM refuses to start. Requiring the unit would turn that into a usage error:

# A JVM size for -Xmx, with a unit: 512m, 4g.
HEAP_SIZE = re.compile(r"[1-9][0-9]*[kKmMgG]")

@yili-db

yili-db commented Nov 10, 2026

Copy link
Copy Markdown
Collaborator Author

/review

@shba24 shba24 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks Yi, all six earlier comments are addressed in 2b2387d, and I checked each locally: the halt repro now prints 1 test JVM(s) exited early (exit code 137) plus the exit code, and test_run_tests.py now fails when globalSettings or the durations cleanKeepFiles entry is removed. I also ran the full suite through dev/run-tests.py with defaults on a 32-core box: 212 suites, 3152 tests, 0 failed, 6m58s.

Approving. The inline comments are all nits, not blockers: one test gap for the suite split, and three robustness points in the script (container memory, hidden sbt errors, a bad durations row). Feel free to take or skip them here or in a follow-up.

val loads = Array.fill(numGroups)(0.0)
val groups = Array.fill(numGroups)(Vector.empty[TestDefinition])
sorted.foreach { t =>
val i = loads.indices.minBy(loads)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit (not a blocker): nothing checks that the suites actually spread across the groups. I changed this line to val i = 0 (every suite in group 0, the other group empty) and project/tests/test_run_tests.py still printed PASS, because N suites in 2 test JVMs counts groups, not their contents. How about logging each group's size and asserting none is empty? For example, here:

        groups.zipWithIndex.map { case ((groupTests, load), i) =>
          streams.value.log.info(f"  test-group-$i: ${groupTests.size} suites, ~$load%.0fs")

and in check_parallel_run:

    sizes = [int(n) for n in re.findall(r"test-group-\d+: (\d+) suites", log.read_text())]
    assert len(sizes) == 2 and min(sizes) > 0, f"suites not spread across both groups: {sizes}"

Feel free to take or skip.

Comment thread dev/run-tests.py Outdated
continue
# "max" (v2) or a huge value (v1) means no limit.
if limit != "max" and int(limit) < 1 << 60:
available = min(available, int(limit) - usage)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit (not a blocker): inside a memory-limited container, memory.current / memory.usage_in_bytes include reclaimable page cache, so limit - usage can drop close to 0 after a build has warmed the cache. With a 32 GiB limit and 30 GiB "used" I get Using 1 test JVMs: 16 from half the CPUs, 1 fit in 2 GB available memory. On this box the cgroup's usage is 123 GB, of which 67 GB is cache, so the effect is large. Subtracting inactive_file (v2 memory.stat) / total_inactive_file (v1) from usage would match what MemAvailable does on the host path:

def reclaimable(stat_file, key):
    try:
        with open(stat_file) as f:
            for line in f:
                name, value = line.split()
                if name == key:
                    return int(value)
    except (OSError, ValueError):
        pass
    return 0

Related, line 132: os.cpu_count() is the host's CPUs; len(os.sched_getaffinity(0)) respects cpusets (under taskset -c 0-3 the script still picks 16 JVMs). Feel free to take or skip.

Comment thread dev/run-tests.py
print(f"{len(dead_jvms)} test JVM(s) exited early (exit code {', '.join(dead_jvms)}), so "
"their remaining suites did not run and are missing above. Exit code 137 usually "
"means out of memory: lower -p or raise --jvm-heap.")
if returncode != 0:

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit (not a blocker): when sbt fails before any test runs, the console doesn't say why. dev/run-tests.py -p 2 client/tset prints only:

0 suites, 0 tests, 0 failed, wall time 0m16s
Slowest suites:
sbt exited with code 1; see the log for details

while the log has [error] Not a valid key: tset (similar: test, target, tags). STREAMED drops it (and root-level errors like (update) ...ResolveException). How about printing the first few [error] lines from the log when sbt failed and no suite reported? Something like:

    if returncode != 0 and not results and not dead_jvms:
        with open(log_path) as f:
            errors = [line.rstrip() for line in f if line.startswith("[error]")][:10]
        print("\n".join(errors))

Comment thread dev/run-tests.py Outdated
try:
if os.path.isfile(DURATIONS_FILE):
with open(DURATIONS_FILE) as f:
durations = {row[0]: float(row[1]) for row in csv.reader(f) if len(row) == 2}

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit (not a blocker): one unparsable row (for example a cut-off b.Trunc, from a Ctrl-C during the non-atomic write) makes this comprehension raise, so the merge is skipped on every later run and the file never updates again; the Scala reader skips the same row silently. Skipping bad rows here too, and writing via a temp file plus os.replace, would keep it self-healing:

            for row in csv.reader(f):
                try:
                    durations[row[0]] = float(row[1])
                except (IndexError, ValueError):
                    continue

Comment thread dev/run-tests.py Outdated
Comment on lines +47 to +50
CGROUP_MEMORY_FILES = [
("/sys/fs/cgroup/memory.max", "/sys/fs/cgroup/memory.current"),
("/sys/fs/cgroup/memory/memory.limit_in_bytes", "/sys/fs/cgroup/memory/memory.usage_in_bytes"),
]

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(ai assisted) These fixed paths read the cgroup mount root. The process’s memory limit can be in a child directory.

Comment thread dev/run-tests.py Outdated
Comment on lines +174 to +175
for line in proc.stdout:
log.write(line)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(ai assisted) A failed log write or terminal write skips the normal proc.wait(). There is no cleanup path that stops sbt and its test JVMs.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[AI Assisted] Fixed in c812b3f: sbt now runs in its own process group, and if streaming fails (a log or terminal write, or Ctrl-C) the script sends SIGTERM to the whole group, then SIGKILL after 10 s, and only then re-raises. A Ctrl-C mid-run with two test JVMs up now leaves no Java process behind.

One nuance from checking it: a failed terminal write did not actually orphan sbt before. Once the script exits, sbt's next write to the closed pipe fails and it exits, taking its test JVMs with it. So the gap was the time until sbt wrote again, which can be long during a quiet test. The process group was also needed for Ctrl-C: sbt no longer gets the signal directly, so the script has to stop it.

@timothyw553
timothyw553 self-requested a review November 11, 2026 00:53

@timothyw553 timothyw553 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good.

@shba24 shba24 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks Yi, all four nits from my last review are addressed in c812b3f, and I re-checked each locally:

  • Suite split: with val i = 0 (all suites in one group) test_run_tests.py now fails with suites not spread across both groups: [10, 0]; at the head the client groups get 3 and 7 suites.
  • Container sizing: under taskset -c 0-3 the script now picks 2 JVMs instead of 16, and the new check_cgroup_memory covers the parent-limit and inactive_file math.
  • Hidden sbt errors: dev/run-tests.py -p 2 client/tset now prints [error] Not a valid key: tset (similar: test, target, tags) before the exit code.
  • Durations file: the damaged-row case is covered by check_durations_file.

I also sent SIGINT mid-run: the script exits with KeyboardInterrupt and no sbt or test JVM is left behind. The full suite through dev/run-tests.py with defaults passes: 212 suites, 3152 tests, 0 failed, 7m06s (one earlier run on a heavily loaded box had a single SdkVolumeAccessControlCRUDTest timeout that passed 3/3 on rerun, unrelated to this change).

LGTM, approving.

yili-db added a commit that referenced this pull request Nov 11, 2026
…#2159)

## 🥞 Stacked PR
Use this
[link](https://github.com/unitycatalog/unitycatalog/pull/2159/files) to
review incremental changes.
-
[**stack/run_test_fix**](#2159)
[[Files
changed](https://github.com/unitycatalog/unitycatalog/pull/2159/files)]
← _this PR_
-
[stack/run_test_parallel](#2160)
[[Files
changed](https://github.com/unitycatalog/unitycatalog/pull/2160/files/31576409812482675a7f1844c20524b78bb865cd..2b2387dae243b48cb791c630df6fc77eecfd9b14)]
-
[stack/run_test_followups](#2167)
[[Files
changed](https://github.com/unitycatalog/unitycatalog/pull/2167/files/2b2387dae243b48cb791c630df6fc77eecfd9b14..1c4e0c091b3b36ca2c5086a78260a936ebc4fb9c)]

---------
- Add `UnityCatalogServer.Builder.configurationFolder(Path)`, defaulting
to `etc/conf`
- Building a server rewrote `etc/conf/certs.json` and `token.txt` in
place, shared by all tests
- Only the signing keys, `certs.json` and `token.txt` move;
`server.properties`, `hibernate.properties` and the log4j configuration
are still read from `etc/conf`
- Give each `BaseServerTest` its own `@TempDir` `configurationFolder`
  - Signing keys are generated once per JVM and copied in
  - Tests that sign tokens or read `token.txt` use that folder
- `UnityCatalogServerTest` checks that the server writes `certs.json`
and `token.txt` there
- Add test-only Spark settings to the `spark` project
- `spark.databricks.delta.snapshotPartitions=2`: Delta's default of 50
snapshot partitions dominates small test tables; cuts the slowest Delta
suites by a fifth to a third
- `spark.ui.enabled=false` and `spark.ui.showConsoleProgress=false`: no
web UI port per Spark session and no progress bars in the test output

Signed-off-by: Yi Li <[email protected]>

**PR Checklist**

- [x] A description of the changes is added to the description of this
PR.
- [ ] If there is a related issue, make sure it is linked to this PR.
- [x] If you've fixed a bug or added code that should be tested, add
tests!
- [ ] If you've added or modified a feature, documentation in `docs` is
updated

**Description of changes**

<!-- Please state what you've changed and how it might affect the users.
-->

This pull request and its description were written by Isaac.

---------

Signed-off-by: Yi Li <[email protected]>
@yili-db
yili-db force-pushed the stack/run_test_parallel branch from c812b3f to f051e2f Compare November 11, 2026 21:22
yili-db and others added 4 commits November 12, 2026 00:59
- Add `project/TestParallelization.scala`, enabled only by `TEST_PARALLELISM`
  - Splits each project's suites into forked JVMs, longest first by recorded durations
  - Lifts sbt's default limit of one forked test JVM at a time across the build
- Add `dev/run-tests.py`, running the same tests as `build/sbt test`
  - Picks the JVM count from CPUs and available memory
  - Logs to `target/test-logs/`, prints a failure summary, warns if tests write `etc/conf`
- Make the script the preferred way to run tests in `AGENTS.md` and `README.md`
  - Clarify that `-J-Xmx` sets sbt's own heap, not the forked test JVMs'
- Full suite on a 32-core machine: 3.5-5.5 min, versus 26 min with `build/sbt test`

Signed-off-by: Yi Li <[email protected]>
Signed-off-by: Yi Li <[email protected]>
Signed-off-by: Yi Li <[email protected]>
- Memory and CPU sizing
  - Find this process's cgroup through `/proc/self/cgroup` and check each parent's limit
  - Do not count reclaimable page cache (`inactive_file`) as used
  - Count only the CPUs the process may run on (`sched_getaffinity`)
- Stop sbt and its test JVMs if the script fails or gets Ctrl-C while streaming
- Show sbt's first `[error]` lines when sbt fails before any suite reports
- Skip damaged rows in `test-durations.csv`, and write it through a temp file
- Log each test group's size; `test_run_tests.py` asserts both client groups get suites
- `test_run_tests.py` also checks the cgroup math, the durations file and the error display

Co-authored-by: Isaac <[email protected]>
Signed-off-by: Yi Li <[email protected]>
@yili-db
yili-db force-pushed the stack/run_test_parallel branch from f051e2f to 0e51e0e Compare November 12, 2026 01:08
@yili-db
yili-db merged commit f418387 into unitycatalog:main Nov 12, 2026
26 of 29 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants