Skip to content

Commit

Permalink
Merge pull request #38 from clue-labs/garbage
Browse files Browse the repository at this point in the history
Update test suite to collect all garbage cycles
  • Loading branch information
WyriHaximus committed Jul 11, 2023
2 parents 87d1399 + b3b070a commit e032661
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions tests/FirstTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,9 @@ public function testCancelPendingStreamWillReject()

public function testShouldResolveWithoutCreatingGarbageCyclesAfterDataThenClose()
{
\gc_collect_cycles();
while (gc_collect_cycles()) {
// collect all garbage cycles
}

$stream = new ThroughStream();

Expand All @@ -130,7 +132,10 @@ public function testShouldResolveWithoutCreatingGarbageCyclesAfterDataThenClose(

public function testCancelPendingStreamWillRejectWithoutCreatingGarbageCycles()
{
\gc_collect_cycles();
while (gc_collect_cycles()) {
// collect all garbage cycles
}

$stream = new ThroughStream();

$promise = Stream\first($stream);
Expand Down

0 comments on commit e032661

Please sign in to comment.