Selaa lähdekoodia

Slow down memory_limit test

Otherwise the test may execute so fast, that the
watchdog thread, ticking at 10ms currently, is too
slow to detect the memory limit situation.
Stefan Siegl 10 vuotta sitten
vanhempi
commit
cd44e72683
1 muutettua tiedostoa jossa 5 lisäystä ja 2 poistoa
  1. 5 2
      tests/memory_limit.phpt

+ 5 - 2
tests/memory_limit.phpt

@@ -7,8 +7,11 @@ Test V8::executeString() : Time limit
 $JS = <<< EOT
 $JS = <<< EOT
 var text = "abcdefghijklmnopqrstuvwyxz0123456789";
 var text = "abcdefghijklmnopqrstuvwyxz0123456789";
 var memory = "";
 var memory = "";
-for (var i = 0; i < 1000000; ++i) {
-    memory += text;
+for (var i = 0; i < 100; ++i) {
+    for (var j = 0; j < 10000; ++j) {
+        memory += text;
+    }
+    sleep(0);
 }
 }
 EOT;
 EOT;