Skip to content

socat CI: run the test suite as parallel shards via parallel-make-check.py#10771

Merged
dgarske merged 3 commits into
wolfSSL:masterfrom
julek-wolfssl:socat-parallel-shards
Jun 25, 2026
Merged

socat CI: run the test suite as parallel shards via parallel-make-check.py#10771
dgarske merged 3 commits into
wolfSSL:masterfrom
julek-wolfssl:socat-parallel-shards

Conversation

@julek-wolfssl

Copy link
Copy Markdown
Member

The socat suite runs ~590 tests sequentially in a single job and is
sleep-bound: a handful of tests sit in fixed waits (INTRANETRIPPER alone sleeps
~140s at -t 1.0) that dominate the ~10 min runtime.

This generalizes the shared parallel runner
(.github/scripts/parallel-make-check.py) so any command can ride its worker
pool, not just wolfSSL build configs, and uses it to shard the socat tests
across a single runner.

parallel-make-check.py — three additive config keys

Defaults keep existing build configs behaving exactly as before:

  • build: false — skip configure/make/check; run only the prepare/run
    commands, so an arbitrary command can use the pool.
  • netns: true — run each command under bwrap --unshare-net (its own
    network namespace) so parallel network tests can't collide on ports. Needs
    bubblewrap; warns and falls back to the shared namespace if bwrap is
    missing.
  • shards: N — fan a config out into N instances, each with $SHARD
    (1..N) and $SHARDS=N in its env and its own build-<name>-<k> dir. The
    pool (--threads) bounds how many run at once, so N > threads
    load-balances dynamically. Composes with the existing --shard CI split.

socat.yml

One config (build:false, netns:true, shards:12) runs a round-robin slice
of test.sh per shard (seq $SHARD $SHARDS 999), each in its own network
namespace and its own copy of the build dir (their generated certs/temp files
would otherwise race). --no-fail-fast runs every shard so all unexpected
failures are reported, as the unsharded run did. The job timeout drops from 30
to 15 min.

Copilot AI review requested due to automatic review settings June 24, 2026 21:06
@julek-wolfssl julek-wolfssl self-assigned this Jun 24, 2026
@dgarske dgarske self-requested a review June 24, 2026 21:07

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

@julek-wolfssl julek-wolfssl marked this pull request as ready for review June 24, 2026 21:11
@github-actions

Copy link
Copy Markdown

retest this please

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

Comment thread .github/workflows/socat.yml
Comment thread .github/scripts/parallel-make-check.py

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

Comment thread .github/workflows/socat.yml
Comment thread .github/scripts/parallel-make-check.py
…mands

Let any command ride the build/check pool, not just wolfSSL builds:
  build  false skips configure/make/check (config is just prepare+run)
  netns  true runs each command under 'bwrap --unshare-net --cap-add
         CAP_NET_ADMIN' (its own network namespace) so parallel network
         tests can't collide on ports and can configure that namespace
  shards fan a config out into N instances, each with $SHARD (1..N) and
         $SHARDS=N in its env and its own build-<name>-<k> dir, so a
         command can split its work N ways (the pool load-balances them)

Error out, rather than silently degrade, on two misconfigurations that
otherwise surface as confusing test failures: netns requested but bwrap
missing (commands would share the host namespace and collide on ports),
and config-name collisions after shard fan-out (two jobs would share a
build dir and race).
The socat suite is sleep-bound and slow run serially. Drive it through
parallel-make-check.py as ~6 shards per CPU, 2 running per CPU at once: each
shard runs a round-robin slice of the tests in its own bwrap network
namespace (so parallel shards don't collide on ports) and its own build-dir
copy. The work is almost all waiting, so the oversubscription just overlaps
the waits.

Install bubblewrap so the netns isolation actually happens (without it the
runner silently shares one namespace and the shards collide). Each fresh
netns is IPv4-loopback only, so re-create IPv6 loopback (CAP_NET_ADMIN) for
the ::1 / dual-stack tests, and add non-loopback placeholders (fc00::1,
192.0.2.1) so glibc's AI_ADDRCONFIG still returns both families - without
them socat's getaddrinfo fails on numeric non-loopback addresses, e.g. the
multicast tests. Relax the AppArmor unprivileged-userns restriction so the
bwrap netns + CAP_NET_ADMIN work on ubuntu-24.04.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

Comment thread .github/workflows/socat.yml
Comment thread .github/scripts/parallel-make-check.py Outdated
netns needs bwrap; without it commands silently share the host network
namespace and parallel network tests collide on ports. Skip the check for
--list (it inspects configs, runs nothing), hard-fail on CI so a missing-
bubblewrap misconfig can't silently degrade, and locally just warn and fall
back to the shared namespace.
@dgarske dgarske merged commit 1044418 into wolfSSL:master Jun 25, 2026
292 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.

4 participants