Fix PHP CI legacy and edge gateway tests

- Match self-serve legacy test double invoice signature.
- Wait for the edge gateway integration database before bootstrapping schema.
This commit is contained in:
Jeppe B
2026-05-28 18:03:30 +02:00
parent 90ebec84bf
commit 893ed1bda5
2 changed files with 21 additions and 3 deletions
@@ -384,8 +384,7 @@ function edge_gateway_integration_context(): array
}
};
$db = new db($dbConfig);
$db->connect();
$db = edge_gateway_integration_wait_for_db($dbConfig);
$GLOBALS['db'] = $db;
$mysqli = $db->conn();
@@ -412,6 +411,25 @@ function edge_gateway_integration_context(): array
];
}
function edge_gateway_integration_wait_for_db(array $dbConfig): db
{
$deadline = microtime(true) + 60;
$lastError = null;
do {
try {
$db = new db($dbConfig);
$db->connect();
return $db;
} catch (RuntimeException $exception) {
$lastError = $exception;
usleep(500000);
}
} while (microtime(true) < $deadline);
throw $lastError ?? new RuntimeException('Database connection failed before a connection attempt completed.');
}
/**
* @return array{host:string,user:string,password:string,database:string,port:int}
*/