Skip to content

Commit fb4520c

Browse files
committed
Account for slow running tests that timeout.
1 parent 88dd81a commit fb4520c

2 files changed

Lines changed: 19 additions & 9 deletions

File tree

.github/workflows/bsd.yml

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,12 @@ on:
1919
paths-ignore: *ignore_paths
2020

2121
jobs:
22-
FreeBSD:
22+
BSD:
2323
runs-on: ubuntu-latest
2424
strategy:
2525
fail-fast: false
2626
matrix:
27+
os: ["freebsd", "ghostbsd"]
2728
arch: ["x86_64", "aarch64"]
2829
toolset:
2930
- { cxx: "g++16", package: "lang/gcc16", b2tool: gcc }
@@ -42,25 +43,31 @@ jobs:
4243
- { cxx: "clang++13", package: "devel/llvm13", b2tool: clang }
4344
- { cxx: "clang++12", package: "devel/llvm12", b2tool: clang }
4445
exclude:
45-
- { arch: "aarch64", toolset: { b2tool: gcc } }
46+
- { os: "freebsd", arch: "aarch64", toolset: { b2tool: gcc } }
47+
- { os: "ghostbsd", arch: "aarch64" }
4648
steps:
4749
- name: Checkout
4850
uses: actions/checkout@main
4951
- name: Start VM
5052
id: vm
51-
uses: vmactions/freebsd-vm@v1
53+
uses: vmactions/${{ matrix.os }}-vm@v1
5254
with:
5355
arch: ${{ matrix.arch }}
5456
usesh: true
5557
custom-shell-name: vmsh
56-
- name: Info
58+
- name: Info-Basic
5759
shell: vmsh {0}
5860
run: |
5961
echo ${PWD}
6062
whoami
6163
env
62-
freebsd-version
6364
uname -a
65+
- name: Info-FreeBSD
66+
if: ${{ matrix.os == 'freebsd' }}
67+
shell: vmsh {0}
68+
run: |
69+
echo ${PWD}
70+
freebsd-version
6471
sysctl hw.ncpu
6572
sysctl hw.physmem
6673
sysctl hw.usermem
@@ -85,8 +92,8 @@ jobs:
8592
run: |
8693
set -e
8794
CXX_PATH=`which ${{ matrix.toolset.cxx }}`
95+
B2_ARGS=${{ case(arch != 'x86_64', '--slow', '') }}
8896
cd test
8997
echo "using ${{ matrix.toolset.b2tool }} : : ${CXX_PATH} ;" > ${HOME}/user-config.jam
90-
python3 grep.py ${{ matrix.toolset.b2tool }}
91-
python3 test_all.py ${{ matrix.toolset.b2tool }}
98+
python3 test_all.py ${{ matrix.toolset.b2tool }} ${B2_ARGS}
9299
cd ..

test/test_all.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
import inspect
2222

2323
xml = "--xml" in sys.argv
24+
slow = "--slow" in sys.argv
2425
toolset = BoostBuild.get_toolset()
2526

2627

@@ -63,8 +64,10 @@ def sig_handle(sig, frame):
6364
# Translate the SIGILL to an exception to stop with an apropos error.
6465
raise TimeoutError()
6566

66-
# Timer for the 5 minute limit for each test.
67-
timeout = threading.Timer(5 * 60, early_exit)
67+
# Timer for the 5 minute limit for each test. Unless we indicate it's a
68+
# slow running context (like inside a VM).
69+
timeout_seconds = 15 * 60 if slow else 5 * 60
70+
timeout = threading.Timer(timeout_seconds, early_exit)
6871
timeout.start()
6972
signal.signal(signal.SIGILL, sig_handle)
7073
ts = time.perf_counter()

0 commit comments

Comments
 (0)