소스 검색

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

Andy Li 6 년 전
부모
커밋
fb2e7ae14e
1개의 변경된 파일10개의 추가작업 그리고 6개의 파일을 삭제
  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)
 				if (exitCode != random)
 					trace(name);
 					trace(name);
 				Assert.equals(random, exitCode);
 				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() {
 	function testExitCode() {