Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/run-package-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,7 @@ export -f run_package_test_parallel
export STRICT
export PREFER_LOWEST
export FAILED_FILE
export GRPC_ENABLE_FORK_SUPPORT=1

# Determine optimal parallelism: default to the number of CPU cores on the host runner
MAX_JOBS=${MAX_JOBS:-$(nproc 2>/dev/null || echo 8)}
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/unit-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ on:

permissions:
contents: read

env:
GRPC_ENABLE_FORK_SUPPORT: 1

jobs:
test:
strategy:
Expand Down
3 changes: 3 additions & 0 deletions Auth/phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,7 @@
<directory suffix="Test.php">tests</directory>
</testsuite>
</testsuites>
<php>
<env name="GRPC_ENABLE_FORK_SUPPORT" value="1"/>
</php>
</phpunit>
5 changes: 5 additions & 0 deletions Auth/tests/Cache/RaceConditionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,11 @@ public function testRaceCondition(string $cacheClass)
if (!function_exists('pcntl_fork')) {
$this->markTestSkipped('pcntl_fork is not available');
}
if (extension_loaded('grpc') && !getenv('GRPC_ENABLE_FORK_SUPPORT')) {
$this->markTestSkipped(
'Cannot run fork test with grpc extension unless GRPC_ENABLE_FORK_SUPPORT=1 is set.'
);
}
for ($i = 0; $i < 50; $i++) {
// SysV Cache warmup to prevent segment creation race
if ($cacheClass === SysVCacheItemPool::class) {
Expand Down
1 change: 1 addition & 0 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
</testsuites>
<php>
<ini name="memory_limit" value="2048M"/>
<env name="GRPC_ENABLE_FORK_SUPPORT" value="1"/>
</php>

</phpunit>
Loading