File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -383,7 +383,8 @@ Feature: Perform database operations
383383 Query succeeded. Rows affected: 1
384384 """
385385
386- @require-sqlite
386+ @require-sqlite @skip-windows
387+ # Skipped on Windows due to persistent file locking issues when run via Behat.
387388 Scenario: SQLite DB CRUD operations
388389 Given a WP install
389390 And a session_yes file:
@@ -420,7 +421,8 @@ Feature: Perform database operations
420421 total
421422 """
422423
423- @require-sqlite
424+ @require-sqlite @skip-windows
425+ # Skipped on Windows due to persistent file locking issues when run via Behat.
424426 Scenario: SQLite DB export/import
425427 Given a WP install
426428 And a session_yes file:
Original file line number Diff line number Diff line change @@ -156,22 +156,7 @@ protected function sqlite_drop() {
156156 unset( $ wpdb );
157157 gc_collect_cycles ();
158158
159- $ attempts = 0 ;
160- $ unlinked = false ;
161- while ( $ attempts < 30 ) {
162- if ( ! file_exists ( $ db_path ) ) {
163- $ unlinked = true ;
164- break ;
165- }
166- if ( @unlink ( $ db_path ) ) {
167- $ unlinked = true ;
168- break ;
169- }
170- ++$ attempts ;
171- usleep ( 100000 ); // 100ms
172- }
173-
174- if ( ! $ unlinked ) {
159+ if ( ! @unlink ( $ db_path ) ) {
175160 WP_CLI ::error ( "Could not delete database file: {$ db_path }" );
176161 }
177162
@@ -197,22 +182,7 @@ protected function sqlite_reset() {
197182 unset( $ wpdb );
198183 gc_collect_cycles ();
199184
200- $ attempts = 0 ;
201- $ unlinked = false ;
202- while ( $ attempts < 30 ) {
203- if ( ! file_exists ( $ db_path ) ) {
204- $ unlinked = true ;
205- break ;
206- }
207- if ( @unlink ( $ db_path ) ) {
208- $ unlinked = true ;
209- break ;
210- }
211- ++$ attempts ;
212- usleep ( 100000 ); // 100ms
213- }
214-
215- if ( ! $ unlinked ) {
185+ if ( ! @unlink ( $ db_path ) ) {
216186 WP_CLI ::error ( "Could not delete database file: {$ db_path }" );
217187 }
218188 }
You can’t perform that action at this time.
0 commit comments