Skip to content

Commit

Permalink
Fix Laravel Octane flakiness
Browse files Browse the repository at this point in the history
  • Loading branch information
PROFeNoM committed Jan 21, 2025
1 parent f1508ab commit e1be028
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions tests/Integrations/Laravel/Octane/CommonScenariosTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ public function testScenarioGetReturnString()

$webRequestTrace = null;
foreach ($traces as $trace) {
if ($trace[0]["name"] === "laravel.request") {
if ($trace[0]["name"] === "laravel.request" && str_contains($trace[0]["resource"], 'App\\Http\\Controllers')) {
$webRequestTrace = $trace;
}
}
Expand Down Expand Up @@ -152,7 +152,7 @@ public function testScenarioGetWithView()

$webRequestTrace = null;
foreach ($traces as $trace) {
if ($trace[0]["name"] === "laravel.request") {
if ($trace[0]["name"] === "laravel.request" && str_contains($trace[0]["resource"], 'App\\Http\\Controllers')) {
$webRequestTrace = $trace;
}
}
Expand Down Expand Up @@ -236,7 +236,7 @@ public function testScenarioGetWithException()

$webRequestTrace = null;
foreach ($traces as $trace) {
if ($trace[0]["name"] === "laravel.request") {
if ($trace[0]["name"] === "laravel.request" && str_contains($trace[0]["resource"], 'App\\Http\\Controllers')) {
$webRequestTrace = $trace;
}
}
Expand Down Expand Up @@ -282,7 +282,7 @@ public function testScenarioGetToMissingRoute()

foreach ($traces as $trace) {
foreach ($trace as $span) {
if ($span && isset($span["name"]) && $span["name"] === "laravel.request") {
if ($span && isset($span["name"]) && $span["name"] === "laravel.request" && $span["resource"] === 'GET /does_not_exist') {
return true;
}
}
Expand Down

0 comments on commit e1be028

Please sign in to comment.