Run compiler test suite in parallel on Fuchsia

This commit is contained in:
David Koloski 2023-02-28 18:04:27 -05:00
parent 31f858d9a5
commit c9f1a541b3
2 changed files with 28 additions and 18 deletions

View File

@ -9,6 +9,7 @@ https://doc.rust-lang.org/stable/rustc/platform-support/fuchsia.html#aarch64-unk
import argparse
from dataclasses import dataclass
import fcntl
import glob
import hashlib
import json
@ -146,6 +147,9 @@ class TestEnvironment:
def zxdb_script_path(self):
return os.path.join(self.tmp_dir(), "zxdb_script")
def pm_lockfile_path(self):
return os.path.join(self.tmp_dir(), "pm.lock")
def log_info(self, msg):
print(msg)
@ -460,6 +464,9 @@ class TestEnvironment:
stderr=self.subprocess_output(),
)
# Create lockfiles
open(self.pm_lockfile_path(), 'a').close()
# Write to file
self.write_to_file()
@ -676,19 +683,25 @@ class TestEnvironment:
log("Publishing package to repo...")
# Publish package to repo
subprocess.check_call(
[
self.tool_path("pm"),
"publish",
"-a",
"-repo",
self.repo_dir(),
"-f",
far_path,
],
stdout=log_file,
stderr=log_file,
)
with open(self.pm_lockfile_path(), 'w') as pm_lockfile:
fcntl.lockf(pm_lockfile.fileno(), fcntl.LOCK_EX)
subprocess.check_call(
[
self.tool_path("pm"),
"publish",
"-a",
"-repo",
self.repo_dir(),
"-f",
far_path,
],
stdout=log_file,
stderr=log_file,
)
# This lock should be released automatically when the pm
# lockfile is closed, but we'll be polite and unlock it now
# since the spec leaves some wiggle room.
fcntl.lockf(pm_lockfile.fileno(), fcntl.LOCK_UN)
log("Running ffx test...")

View File

@ -717,7 +717,7 @@ run the full `tests/ui` test suite:
--stage=2 \
test tests/ui \
--target x86_64-unknown-fuchsia \
--run=always --jobs 1 \
--run=always \
--test-args --target-rustcflags \
--test-args -Lnative=${SDK_PATH}/arch/{x64|arm64}/sysroot/lib \
--test-args --target-rustcflags \
@ -729,9 +729,6 @@ run the full `tests/ui` test suite:
)
```
*Note: The test suite cannot be run in parallel at the moment, so `x.py`
must be run with `--jobs 1` to ensure only one test runs at a time.*
By default, `x.py` compiles test binaries with `panic=unwind`. If you built your
Rust toolchain with `-Cpanic=abort`, you need to tell `x.py` to compile test
binaries with `panic=abort` as well:
@ -908,7 +905,7 @@ through our `x.py` invocation. The full invocation is:
--stage=2 \
test tests/${TEST} \
--target x86_64-unknown-fuchsia \
--run=always --jobs 1 \
--run=always \
--test-args --target-rustcflags \
--test-args -Lnative=${SDK_PATH}/arch/{x64|arm64}/sysroot/lib \
--test-args --target-rustcflags \