Skip to content

Commit ca13693

Browse files
committed
Clean Doltlite lock files in tests
Remove Doltlite's persistent per-database lock file alongside the standard SQLite sidecars so file-based connection tests leave their temporary directories empty.
1 parent 8962c16 commit ca13693

3 files changed

Lines changed: 9 additions & 1 deletion

File tree

packages/mysql-on-sqlite/tests/WP_PDO_MySQL_On_SQLite_PDO_API_Tests.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -598,7 +598,13 @@ public function data_pdo_fetch_methods(): Generator {
598598
}
599599

600600
private function remove_database_files( string $path ): void {
601-
foreach ( array( $path, $path . '-wal', $path . '-shm', $path . '-journal' ) as $file ) {
601+
foreach ( array(
602+
$path,
603+
$path . '-wal',
604+
$path . '-shm',
605+
$path . '-journal',
606+
dirname( $path ) . '/.' . basename( $path ) . '-lock',
607+
) as $file ) {
602608
if ( file_exists( $file ) ) {
603609
unlink( $file );
604610
}

packages/mysql-on-sqlite/tests/WP_SQLite_Connection_Tests.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ public function tearDown(): void {
3434
$this->db_path . '-wal',
3535
$this->db_path . '-shm',
3636
$this->db_path . '-journal',
37+
dirname( $this->db_path ) . '/.' . basename( $this->db_path ) . '-lock',
3738
) as $path ) {
3839
if ( is_string( $path ) && file_exists( $path ) ) {
3940
unlink( $path );

packages/mysql-on-sqlite/tests/WP_SQLite_Driver_Concurrency_Tests.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ public function tearDown(): void {
2424
$this->db_path . '-wal',
2525
$this->db_path . '-shm',
2626
$this->db_path . '-journal',
27+
dirname( $this->db_path ) . '/.' . basename( $this->db_path ) . '-lock',
2728
) as $path ) {
2829
if ( is_string( $path ) && file_exists( $path ) ) {
2930
unlink( $path );

0 commit comments

Comments
 (0)