Skip to content

Commit 5e9d7b9

Browse files
committed
fix: Add sequential testing workaround for parallel test issue
Workaround for Issue #62: Parallel test execution causes intermittent TenantKey unwrap failures (~1-10% failure rate). This temporary solution: - Checks for .preflight-sequential-tests marker file - Uses sequential testing if marker exists - Allows PR #61 to proceed while proper fix developed See: #62 Will be removed when Issue #62 is properly fixed with per-process KEK files or test isolation improvements.
1 parent 1b47539 commit 5e9d7b9

File tree

3 files changed

+19
-2
lines changed

3 files changed

+19
-2
lines changed

.preflight-sequential-tests

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
WORKAROUND for Issue #62: Parallel test execution causes intermittent failures
2+
See: https://github.com/SecPal/api/issues/62
3+
4+
This file forces sequential test execution in preflight.sh until the issue is resolved.
5+
Remove this file once parallel test isolation is fixed.
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
SPDX-FileCopyrightText: 2025 SecPal Contributors
2+
3+
SPDX-License-Identifier: AGPL-3.0-or-later

scripts/preflight.sh

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,11 +68,20 @@ run_phpstan() {
6868
run_tests() {
6969
local cmd_prefix="$1"
7070
local test_exit=0
71+
72+
# WORKAROUND: Parallel test execution has intermittent failures (Issue #62)
73+
# Use sequential testing until fixed
74+
# See: https://github.com/SecPal/api/issues/62
75+
local parallel_flag=""
76+
if [ ! -f .preflight-sequential-tests ]; then
77+
parallel_flag="--parallel"
78+
fi
79+
7180
# Run tests (Laravel Artisan → Pest → PHPUnit)
7281
if [ -f artisan ]; then
73-
${cmd_prefix} php artisan test --parallel || test_exit=$?
82+
${cmd_prefix} php artisan test ${parallel_flag} || test_exit=$?
7483
elif [ -x ./vendor/bin/pest ]; then
75-
${cmd_prefix} ./vendor/bin/pest --parallel || test_exit=$?
84+
${cmd_prefix} ./vendor/bin/pest ${parallel_flag} || test_exit=$?
7685
elif [ -x ./vendor/bin/phpunit ]; then
7786
${cmd_prefix} ./vendor/bin/phpunit || test_exit=$?
7887
fi

0 commit comments

Comments
 (0)