Skip to content

Commit cca8008

Browse files
committed
Fix memory leak test
Add check for signal test
1 parent 6a9ec4e commit cca8008

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/Test.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -436,7 +436,7 @@ function testNoMemoryLeak($type, $args)
436436
$loop->run();
437437
}
438438
if ($type === "onSignal") {
439-
$watchers = [$loop->repeat(\SIGUSR1, $fn = function ($watcherId, $i) use (&$fn, $loop, &$watchers) {
439+
$watchers = [$loop->onSignal(\SIGUSR1, $fn = function ($watcherId, $i) use (&$fn, $loop, &$watchers) {
440440
if ($i) {
441441
$watchers[] = $loop->onSignal(\SIGUSR1, $fn, --$i);
442442
} else {
@@ -449,7 +449,7 @@ function testNoMemoryLeak($type, $args)
449449
}
450450
};
451451
$closureMem = memory_get_usage() - $initialMem;
452-
$cb(500); /* just to set up eventual structures inside loop without counting towards memory comparison */
452+
$cb(10000); /* just to set up eventual structures inside loop without counting towards memory comparison */
453453
gc_collect_cycles();
454454
$initialMem = memory_get_usage() - $closureMem;
455455
$cb(10000);
@@ -712,6 +712,9 @@ function testOnSignalWatcher()
712712
});
713713
}
714714

715+
/**
716+
* @depends testSignalCapability
717+
*/
715718
function testInitiallyDisabledOnSignalWatcher()
716719
{
717720
if (!\extension_loaded("posix")) {

0 commit comments

Comments
 (0)