diff --git a/.gitlab/generate-common.php b/.gitlab/generate-common.php index 37aba561fd5..009673d1e91 100644 --- a/.gitlab/generate-common.php +++ b/.gitlab/generate-common.php @@ -200,7 +200,7 @@ function dockerhub_login() { MONGO_INITDB_ROOT_PASSWORD: test sqlsrv: - name: registry.ddbuild.io/images/mirror/sqlserver:2022-latest + name: registry.ddbuild.io/images/mirror/sqlserver:2019-CU15-ubuntu-20.04 alias: sqlsrv-integration variables: ACCEPT_EULA: Y diff --git a/ext/git.c b/ext/git.c index 343f1752e34..0bdd5b5aeed 100644 --- a/ext/git.c +++ b/ext/git.c @@ -272,6 +272,8 @@ void replace_git_metadata(git_metadata_t *git_metadata, zend_string *commit_sha, void refresh_git_metadata_if_needed(zend_string *cwd, git_metadata_t *git_metadata) { zend_string *git_dir = find_git_dir(ZSTR_VAL(cwd)); if (!git_dir) { + // Git directory no longer exists - invalidate cached entry + zend_hash_del(&DDTRACE_G(git_metadata), cwd); return; } zend_string *commit_sha = get_commit_sha(ZSTR_VAL(git_dir)); @@ -286,6 +288,9 @@ void refresh_git_metadata_if_needed(zend_string *cwd, git_metadata_t *git_metada } else if (commit_sha) { zend_string *repository_url = get_repository_url(ZSTR_VAL(git_dir)); replace_git_metadata(git_metadata, commit_sha, repository_url); + } else if (git_metadata->property_commit) { + // If we previously had a commit SHA but now can't read it, the git folder became invalid + zend_hash_del(&DDTRACE_G(git_metadata), cwd); } zend_string_release(git_dir); diff --git a/tests/Integrations/Laravel/Octane/Latest/CommonScenariosTest.php b/tests/Integrations/Laravel/Octane/Latest/CommonScenariosTest.php index 13b66e2a4ba..d6e56928ece 100644 --- a/tests/Integrations/Laravel/Octane/Latest/CommonScenariosTest.php +++ b/tests/Integrations/Laravel/Octane/Latest/CommonScenariosTest.php @@ -134,7 +134,11 @@ public function testScenarioGetWithView() 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" + && str_contains($span["resource"], 'App\\Http\\Controllers') + ) { return true; } } @@ -219,7 +223,11 @@ public function testScenarioGetWithException() 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" + && str_contains($span["resource"], 'App\\Http\\Controllers') + ) { return true; } } diff --git a/tests/Nginx/NginxServer.php b/tests/Nginx/NginxServer.php index 5eb0f52f26d..40b1377fb98 100644 --- a/tests/Nginx/NginxServer.php +++ b/tests/Nginx/NginxServer.php @@ -103,6 +103,8 @@ public function waitUntilServerRunning() $socket = @fsockopen($this->serverHost, $this->hostPort); if ($socket !== false) { fclose($socket); + // Give nginx and PHP-FPM a bit more time to stabilize after port opens + usleep(500000); return true; } usleep(50000); diff --git a/tests/WebServer.php b/tests/WebServer.php index c0da4de0a90..ce7d27c1dbf 100644 --- a/tests/WebServer.php +++ b/tests/WebServer.php @@ -237,6 +237,10 @@ public function start() self::FCGI_PORT ); $this->server->start(); + + if (!$this->server->waitUntilServerRunning()) { + throw new \Exception('Nginx failed to start within expected time'); + } } }