File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -334,6 +334,10 @@ describe("Multi-Process Database Access", () => {
334334
335335 describe ( "File Locking and Error Handling" , ( ) => {
336336 test ( "handles database locked errors gracefully" , async ( ) => {
337+ // Use longer timeouts on slower CI platforms
338+ const isSlowCI = process . platform === 'darwin' || process . platform === 'win32' ;
339+ const lockHoldTime = isSlowCI ? 5000 : 1000 ;
340+ const writerDelay = isSlowCI ? 2000 : 200 ;
337341 const setupDb = new DatabaseSync ( dbPath ) ;
338342 setupDb . exec ( `
339343 CREATE TABLE lock_test (
@@ -359,7 +363,7 @@ describe("Multi-Process Database Access", () => {
359363 db.exec("COMMIT");
360364 db.close();
361365 console.log("LOCK_RELEASED");
362- }, 1000 ); // Increased lock time for CI reliability
366+ }, ${ lockHoldTime } ); // Platform-specific lock time
363367 ` ;
364368
365369 // Script that tries to write while locked
@@ -381,7 +385,7 @@ describe("Multi-Process Database Access", () => {
381385 } finally {
382386 db.close();
383387 }
384- }, 200 ); // Increased delay for CI reliability
388+ }, ${ writerDelay } ); // Platform-specific delay
385389 ` ;
386390
387391 // Start lock holder process
You can’t perform that action at this time.
0 commit comments