Skip to content

Commit

Permalink
test: more locks to avoid race conditions
Browse files Browse the repository at this point in the history
  • Loading branch information
hrach committed Mar 2, 2025
1 parent b0a5e1b commit 65b9ac9
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 0 deletions.
2 changes: 2 additions & 0 deletions tests/cases/integration/platform.mysql.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ class PlatformMysqlTest extends IntegrationTestCase
{
public function testTables()
{
$this->lockConnection($this->connection);
$dbName = $this->connection->getConfig()['database'];
$tables = $this->connection->getPlatform()->getTables();

Expand All @@ -44,6 +45,7 @@ class PlatformMysqlTest extends IntegrationTestCase

public function testColumns()
{
$this->lockConnection($this->connection);
$columns = $this->connection->getPlatform()->getColumns('books');
$columns = array_map(function($table) {
return (array) $table;
Expand Down
3 changes: 3 additions & 0 deletions tests/cases/integration/platform.postgres.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ class PlatformPostgresTest extends IntegrationTestCase
{
public function testTables()
{
$this->lockConnection($this->connection);
$tables = $this->connection->getPlatform()->getTables();

Assert::true(isset($tables["public.books"]));
Expand All @@ -37,6 +38,7 @@ class PlatformPostgresTest extends IntegrationTestCase

public function testColumns()
{
$this->lockConnection($this->connection);
$columns = $this->connection->getPlatform()->getColumns('books');
$columns = \array_map(function ($column) { return (array) $column; }, $columns);

Expand Down Expand Up @@ -191,6 +193,7 @@ class PlatformPostgresTest extends IntegrationTestCase

public function testForeignKeys()
{
$this->lockConnection($this->connection);
$keys = $this->connection->getPlatform()->getForeignKeys('books');
$keys = \array_map(function ($key) { return (array) $key; }, $keys);

Expand Down
2 changes: 2 additions & 0 deletions tests/cases/integration/platform.sqlserver.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ class PlatformSqlServerTest extends IntegrationTestCase
{
public function testTables()
{
$this->lockConnection($this->connection);
$tables = $this->connection->getPlatform()->getTables();

Assert::true(isset($tables["dbo.books"]));
Expand All @@ -37,6 +38,7 @@ class PlatformSqlServerTest extends IntegrationTestCase

public function testColumns()
{
$this->lockConnection($this->connection);
$columns = $this->connection->getPlatform()->getColumns('books');
$columns = \array_map(function ($column) { return (array) $column; }, $columns);

Expand Down

0 comments on commit 65b9ac9

Please sign in to comment.