Skip to content

Commit e032661

Browse files
authored
Merge pull request #38 from clue-labs/garbage
Update test suite to collect all garbage cycles
2 parents 87d1399 + b3b070a commit e032661

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

tests/FirstTest.php

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,9 @@ public function testCancelPendingStreamWillReject()
115115

116116
public function testShouldResolveWithoutCreatingGarbageCyclesAfterDataThenClose()
117117
{
118-
\gc_collect_cycles();
118+
while (gc_collect_cycles()) {
119+
// collect all garbage cycles
120+
}
119121

120122
$stream = new ThroughStream();
121123

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

131133
public function testCancelPendingStreamWillRejectWithoutCreatingGarbageCycles()
132134
{
133-
\gc_collect_cycles();
135+
while (gc_collect_cycles()) {
136+
// collect all garbage cycles
137+
}
138+
134139
$stream = new ThroughStream();
135140

136141
$promise = Stream\first($stream);

0 commit comments

Comments
 (0)