Skip to content

Commit accd1fb

Browse files
committed
Allow some initial memory allocations
1 parent 566f5d7 commit accd1fb

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

test/EventLoopTest.php

+2-4
Original file line numberDiff line numberDiff line change
@@ -203,15 +203,13 @@ public function testSuspensionWithinCallbackGarbageCollection(): void
203203
$memory = 0;
204204
$i = 0;
205205

206-
EventLoop::repeat(0.001, static function (string $id) use (&$memory, &$i) {
206+
EventLoop::repeat(0, static function (string $id) use (&$memory, &$i) {
207207
$suspension = EventLoop::getSuspension();
208208
EventLoop::defer(static fn () => $suspension->resume());
209209
$suspension->suspend();
210210

211211
if (++$i % 250 === 0) {
212-
\gc_collect_cycles();
213-
214-
if ($memory > 0) {
212+
if ($i > 500) {
215213
self::assertSame($memory, \memory_get_usage());
216214
}
217215

0 commit comments

Comments
 (0)