Serialize the singleton kind fixture across worktrees

This commit is contained in:
ms2k 2026-07-17 03:41:52 +09:00
commit 7bd5316b1b
3 changed files with 18 additions and 3 deletions

View file

@ -94,4 +94,14 @@ if [[ "${cleanup_calls[*]}" != "durable coordination oidc target secret" ]]; the
exit 1
fi
FIXTURE_LOCK_DIR="$RUNTIME/lock-test"
FIXTURE_LOCK_PATH="$FIXTURE_LOCK_DIR/remora-testbed-kind.lock"
acquire_fixture_lock
if XDG_RUNTIME_DIR="$FIXTURE_LOCK_DIR" bash -c \
'source "$1"; acquire_fixture_lock' _ "$ROOT/tests/kind/lib.sh" 9>&-; then
printf 'singleton fixture lock admitted a second worktree process\n' >&2
exit 1
fi
exec 9>&-
printf 'fixture family matrix tests passed\n'

View file

@ -6,6 +6,8 @@ TESTBED="$ROOT/tests/kind"
RUNTIME="$TESTBED/.runtime"
BIN="$RUNTIME/bin"
KUBECONFIG_PATH="$RUNTIME/kubeconfig"
FIXTURE_LOCK_DIR="${XDG_RUNTIME_DIR:-/tmp/remora-$(id -u)}"
FIXTURE_LOCK_PATH="$FIXTURE_LOCK_DIR/remora-testbed-kind.lock"
CONTEXT=kind-remora-testbed
CLUSTER=remora-testbed
NERDCTL_NAMESPACE=remora-wp02
@ -69,8 +71,8 @@ prepare_provider() {
}
acquire_fixture_lock() {
mkdir -p "$RUNTIME"
exec 9>"$RUNTIME/fixture.lock"
mkdir -p "$RUNTIME" "$FIXTURE_LOCK_DIR"
exec 9>"$FIXTURE_LOCK_PATH"
if ! flock --nonblock 9; then
printf 'kind test fixture is already in use\n' >&2
return 1

View file

@ -16,6 +16,9 @@ spec:
- name: tests
image: @@TEST_IMAGE@@
imagePullPolicy: Never
env:
- name: REMORA_OUTBOUND_REQUIRE_IPV6
value: "1"
resources:
requests: {cpu: 100m, memory: 128Mi}
limits: {cpu: "1", memory: 512Mi}