Sfoglia il codice sorgente

[sys test] see if delaying file deletion helps prevent the php error

Andy Li 6 anni fa
parent
commit
fb2e7ae14e
1 ha cambiato i file con 10 aggiunte e 6 eliminazioni
  1. 10 6
      tests/sys/src/TestCommandBase.hx

+ 10 - 6
tests/sys/src/TestCommandBase.hx

@@ -80,14 +80,18 @@ class TestCommandBase extends utest.Test {
 				if (exitCode != random)
 					trace(name);
 				Assert.equals(random, exitCode);
-
-				// Try to avoid unlink(): Resource temporarily unavailable error
-				#if php
-				php.Global.gc_collect_cycles();
-				#end
-				FileSystem.deleteFile(path);
 			}
 		}
+
+		// Try to avoid unlink(): Resource temporarily unavailable error
+		Sys.sleep(0.1);
+		#if php
+		php.Global.gc_collect_cycles();
+		#end
+		for (file in FileSystem.readDirectory("temp")) {
+			if (file == ".gitignore") continue;
+			FileSystem.deleteFile(Path.join(["temp", file]));
+		}
 	}
 
 	function testExitCode() {