Skip to content

Commit 67c3688

Browse files
committed
Split Linux ASAN and MinGW tests across runners
The Linux Meson 64-bit and Windows MinGW jobs often determine CI latency because their test suites take much longer than their cached builds. Split each test suite across two runners while running the setup suite on both. Use Meson's native --slice support for MinGW. The Linux CI image has Meson 1.7, so derive a deterministically sorted test list there instead of using the Meson 1.8 --slice option. Use separate failure-log artifact names for matrix jobs. Share the slice-specific upload step with the existing Windows Visual Studio matrix, whose jobs otherwise use the same artifact name.
1 parent 9f4bd91 commit 67c3688

1 file changed

Lines changed: 61 additions & 6 deletions

File tree

‎.github/workflows/pg-ci.yml‎

Lines changed: 61 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -625,17 +625,24 @@ jobs:
625625
# - Uses address sanitizer, (sanitizer failures are typically printed in the
626626
# server log). We test asan with meson rather than autoconf, as it's a bit
627627
# faster at running the tests.
628+
# - Splits the tests across two runners
628629
# - Uses io_method=io_uring
629630
# - Uses meson feature autodetection
630631
linux-meson-64:
631-
name: Linux - Meson (64-bit)
632+
name: Linux - Meson (64-bit) - Slice ${{ matrix.slice}}/${{ matrix.num_slices}}
632633
needs: [setup, sanity-check]
633634
if: *linux_job_if
634635
runs-on: *linux_runs_on
635636
container: *linux_ci_container
636637
timeout-minutes: 60
637638
env: *linux_env
638639

640+
strategy:
641+
fail-fast: false
642+
matrix:
643+
num_slices: [2]
644+
slice: [1, 2]
645+
639646
steps:
640647
- name: Update Environment
641648
env:
@@ -668,10 +675,47 @@ jobs:
668675

669676
- name: Test world
670677
shell: *su_postgres_shell
671-
run: *meson_test_world_cmd
678+
run: |
679+
ulimit -c unlimited
680+
681+
echo ::group::test_setup
682+
meson test ${{env.MTEST_ARGS}} --suite setup --logbase setup || exit 1
683+
echo ::endgroup::
684+
685+
# The system Meson is older than 1.8, which introduced --slice.
686+
# Emulate its round-robin slicing using the test list instead.
687+
readarray -t test_names < <(
688+
meson test ${{env.MTEST_ARGS}} ${{env.MTEST_TARGET}} \
689+
--list --no-suite setup |
690+
sort |
691+
awk -F ' - ' \
692+
-v slice=${{ matrix.slice}} \
693+
-v slices=${{ matrix.num_slices}} \
694+
'(NR - 1) % slices == slice - 1 {
695+
name = $NF
696+
sub(/:[^ ]+ \/ /, ":", name)
697+
print name
698+
}'
699+
)
700+
meson test ${{env.MTEST_ARGS}} \
701+
--num-processes ${{env.TEST_JOBS}} \
702+
--no-suite setup "${test_names[@]}"
672703
673704
- *linux_collect_cores_step
674-
- *upload_logs_step
705+
- &upload_logs_sliced_step
706+
name: Upload logs
707+
if: failure() && !cancelled()
708+
uses: actions/upload-artifact@v7
709+
with:
710+
name: logs-${{ github.job }}-${{ matrix.slice }}-${{ github.run_id }}-${{ github.run_attempt }}
711+
path: |
712+
**/*.log
713+
**/*.diffs
714+
**/regress_log_*
715+
**/crashlog-*.txt
716+
build/meson-logs/**
717+
**/config.log
718+
if-no-files-found: ignore
675719

676720

677721
# Job: macOS - Meson
@@ -1024,19 +1068,28 @@ jobs:
10241068
call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" x64
10251069
run: *meson_test_world_cmd
10261070

1027-
- *upload_logs_step
1071+
- *upload_logs_sliced_step
10281072

10291073

10301074
# Job: Windows - MinGW - Meson
10311075
windows-mingw:
1032-
name: Windows - MinGW - Meson
1076+
name: Windows - MinGW - Meson - Slice ${{ matrix.slice}}/${{ matrix.num_slices}}
10331077
needs: [setup, sanity-check]
10341078
if: |
10351079
!cancelled() &&
10361080
needs.setup.outputs.mingw == 'true' &&
10371081
needs.sanity-check.result != 'failure'
10381082
runs-on: windows-2022
10391083
timeout-minutes: 60
1084+
1085+
# MinGW is generally one of the slowest CI jobs. Split its tests across
1086+
# two runners, as is already done for the Visual Studio job.
1087+
strategy:
1088+
fail-fast: false
1089+
matrix:
1090+
num_slices: [2]
1091+
slice: [1, 2]
1092+
10401093
env:
10411094
# Avoid port conflicts between concurrent tap tests
10421095
PG_TEST_USE_UNIX_SOCKETS: 1
@@ -1140,9 +1193,11 @@ jobs:
11401193
- *ccache_save_step
11411194

11421195
- name: Test world
1196+
env:
1197+
MTEST_TARGET: --slice ${{ matrix.slice}}/${{ matrix.num_slices}} ${{env.MTEST_TARGET}}
11431198
run: *meson_test_world_cmd
11441199

1145-
- *upload_logs_step
1200+
- *upload_logs_sliced_step
11461201

11471202

11481203
# Job: CompilerWarnings

0 commit comments

Comments
 (0)