Skip to content

Commit 024fe4a

Browse files
authored
fix(ci): harden first telemetry retrieval predicate in InstrumentationTest (#4040)
Root cause: the CI fixture (Frameworks/Custom/Version_Autoloaded) is built with `composer update` against `nikic/fast-route:^1.3` and no committed lock file (Makefile removes composer.lock-php* before updating), so the resolved version tracks whatever the latest 1.3.x release is. The test hard-coded the exact dependency version in the `app-dependencies-loaded` assertion, so each new fast-route release broke the assertion. The resulting failure/retry cascade surfaced as the flaky window-1 `logs_created` telemetry failure. Fix: - Replace the exact-version dependency assertion with a version-agnostic check: exactly one non-ext dependency, named `nikic/fast-route`, with some non-empty reported version. - Harden the window-1 telemetry wait predicate to gate on `logs_created` (instead of `spans_created`) so the first window reliably captures the logs_created metric it asserts on. All other assertions (integrations list, spans_created tags, app-started ordering) are unchanged.
1 parent 992399d commit 024fe4a

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

tests/Integrations/Custom/Autoloaded/InstrumentationTest.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ public function testInstrumentation()
5757

5858
$this->call(GetSpec::create("autoloaded", "/telemetry"));
5959
usleep(500000);
60-
$response = $this->retrieveDumpedData($this->untilTelemetryRequest("spans_created"));
60+
$response = $this->retrieveDumpedData($this->untilTelemetryRequest("logs_created"));
6161

6262
$this->assertGreaterThanOrEqual(3, $response);
6363
$payloads = $this->readTelemetryPayloads($response);
@@ -101,12 +101,12 @@ public function testInstrumentation()
101101

102102
$this->assertEquals("app-started", $payloads[0]["request_type"]);
103103
$this->assertEquals("app-dependencies-loaded", $payloads[1]["request_type"]);
104-
$this->assertEquals([[
105-
"name" => "nikic/fast-route",
106-
"version" => "v1.3.0",
107-
]], array_filter($payloads[1]["payload"]["dependencies"], function ($i) {
104+
$deps = array_values(array_filter($payloads[1]["payload"]["dependencies"], function ($i) {
108105
return strpos($i["name"], "ext-") !== 0;
109106
}));
107+
$this->assertCount(1, $deps);
108+
$this->assertEquals("nikic/fast-route", $deps[0]["name"]);
109+
$this->assertNotEmpty($deps[0]["version"]);
110110
$this->assertEquals("app-integrations-change", $payloads[2]["request_type"]);
111111
$this->assertEquals([
112112
[

0 commit comments

Comments
 (0)