Skip to content

Commit fc58b91

Browse files
authored
flow-php/telemetry-otlp-bridge - isolate grpc tests so the PHP 8.5 shutdown SIGSEGV (grpc#38216) no longer fails CI (#2444)
* fix: set experimental env var on grpc to avoid crashes * fix(flow-php/telemetry-otlp-bridge): isolate grpc tests from PHP 8.5 shutdown segfault - tag grpc-exercising tests with #[Group('grpc')] - split CI into main (--exclude-group grpc) and grpc steps - grpc step continue-on-error on 8.5 only (upstream grpc#38216)
1 parent c9ba7b3 commit fc58b91

5 files changed

Lines changed: 36 additions & 1 deletion

File tree

.github/workflows/job-tests.yml

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,9 +123,36 @@ jobs:
123123
env:
124124
AZURITE_ACCOUNTS: flowphpaccount01:flowphpkey01
125125

126+
# Main suite: everything except the grpc-exercising tests, so grpc is never
127+
# exercised here and the process shuts down cleanly. Must pass.
126128
- name: "Test"
129+
timeout-minutes: 15
130+
run: "just test --exclude-group grpc --log-junit ./var/phpunit/logs/junit.xml ${{ matrix.php-version == '8.3' && '--coverage-clover=./var/phpunit/coverage/clover/coverage.xml' || '' }}"
131+
env:
132+
PGSQL_DATABASE_URL: pgsql://postgres:postgres@127.0.0.1:${{ job.services.postgres.ports['5432'] }}/postgres?serverVersion=11&charset=utf8
133+
MYSQL_DATABASE_URL: mysql://mysql:mysql@127.0.0.1:${{ job.services.mysql.ports['3306'] }}/mysql
134+
SQLITE_DATABASE_URL: "sqlite:///:memory:"
135+
AZURITE_HOST: "localhost"
136+
AZURITE_BLOB_PORT: "10000"
137+
AZURITE_ACCOUNT_NAME: "flowphpaccount01"
138+
AZURITE_ACCOUNT_KEY: "flowphpkey01"
139+
S3_ENDPOINT: "http://localhost:9000"
140+
S3_REGION: "us-east-1"
141+
S3_ACCESS_KEY_ID: "minioadmin"
142+
S3_SECRET_ACCESS_KEY: "minioadmin"
143+
OTEL_RECEIVER_HTTP_ENDPOINT: "http://localhost:4318"
144+
OTEL_RECEIVER_GRPC_ENDPOINT: "localhost:4317"
145+
OTEL_COLLECTOR_METRICS_ENDPOINT: "http://localhost:8888/metrics"
146+
FLOW_PARQUET_TESTS_DEBUG: "0"
147+
148+
# gRPC-exercising tests, isolated. grpc's EventEngine threads race PHP's extension
149+
# dlclose at process shutdown on PHP 8.5/amd64 (upstream grpc#38216, no released fix),
150+
# so this step is allowed to fail ONLY on 8.5. A real grpc test regression on 8.3/8.4
151+
# still fails CI. Remove continue-on-error once grpc ships a fix.
152+
- name: "Test (grpc)"
127153
timeout-minutes: 10
128-
run: "just test --log-junit ./var/phpunit/logs/junit.xml ${{ matrix.php-version == '8.3' && '--coverage-clover=./var/phpunit/coverage/clover/coverage.xml' || '' }}"
154+
continue-on-error: ${{ matrix.php-version == '8.5' }}
155+
run: "just test --group grpc --log-junit ./var/phpunit/logs/grpc-junit.xml"
129156
env:
130157
PGSQL_DATABASE_URL: pgsql://postgres:postgres@127.0.0.1:${{ job.services.postgres.ports['5432'] }}/postgres?serverVersion=11&charset=utf8
131158
MYSQL_DATABASE_URL: mysql://mysql:mysql@127.0.0.1:${{ job.services.mysql.ports['3306'] }}/mysql

src/bridge/telemetry/otlp/tests/Flow/Bridge/Telemetry/OTLP/Tests/Integration/LogExportIntegrationTest.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@
77
use Flow\Bridge\Telemetry\OTLP\Tests\Context\TransportConfiguration;
88
use Flow\Telemetry\Resource;
99
use PHPUnit\Framework\Attributes\DataProvider;
10+
use PHPUnit\Framework\Attributes\Group;
1011

12+
#[Group('grpc')]
1113
final class LogExportIntegrationTest extends IntegrationTestCase
1214
{
1315
#[DataProvider('transportProvider')]

src/bridge/telemetry/otlp/tests/Flow/Bridge/Telemetry/OTLP/Tests/Integration/MetricExportIntegrationTest.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@
77
use Flow\Bridge\Telemetry\OTLP\Tests\Context\TransportConfiguration;
88
use Flow\Telemetry\Resource;
99
use PHPUnit\Framework\Attributes\DataProvider;
10+
use PHPUnit\Framework\Attributes\Group;
1011

12+
#[Group('grpc')]
1113
final class MetricExportIntegrationTest extends IntegrationTestCase
1214
{
1315
#[DataProvider('transportProvider')]

src/bridge/telemetry/otlp/tests/Flow/Bridge/Telemetry/OTLP/Tests/Integration/SpanExportIntegrationTest.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,9 @@
1515
use Flow\Telemetry\Tracer\SpanLink;
1616
use Flow\Telemetry\Tracer\SpanStatus;
1717
use PHPUnit\Framework\Attributes\DataProvider;
18+
use PHPUnit\Framework\Attributes\Group;
1819

20+
#[Group('grpc')]
1921
final class SpanExportIntegrationTest extends IntegrationTestCase
2022
{
2123
#[DataProvider('transportProvider')]

src/bridge/telemetry/otlp/tests/Flow/Bridge/Telemetry/OTLP/Tests/Unit/Transport/GrpcTransportTest.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
use Google\Protobuf\Internal\Message;
1414
use Grpc\BaseStub;
1515
use InvalidArgumentException;
16+
use PHPUnit\Framework\Attributes\Group;
1617
use PHPUnit\Framework\Attributes\RequiresPhpExtension;
1718
use PHPUnit\Framework\TestCase;
1819
use RuntimeException;
@@ -23,6 +24,7 @@
2324
use function extension_loaded;
2425
use function str_contains;
2526

27+
#[Group('grpc')]
2628
final class GrpcTransportTest extends TestCase
2729
{
2830
#[RequiresPhpExtension('grpc')]

0 commit comments

Comments
 (0)