Skip to content
Merged
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
2 changes: 1 addition & 1 deletion .gitlab/generate-common.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 5 additions & 0 deletions ext/git.c
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand All @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
Expand Down Expand Up @@ -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;
}
}
Expand Down
2 changes: 2 additions & 0 deletions tests/Nginx/NginxServer.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
4 changes: 4 additions & 0 deletions tests/WebServer.php
Original file line number Diff line number Diff line change
Expand Up @@ -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');
}
}
}

Expand Down
Loading