Skip to content

Commit 20de50f

Browse files
committed
ci: try fiber based stop waiting also
1 parent c069082 commit 20de50f

1 file changed

Lines changed: 21 additions & 0 deletions

File tree

tests/Integration/Compute/MachinesTest.php

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,27 @@ public function test_start_machine(): void
9292
self::assertTrue($operation->getDone());
9393
}
9494

95+
public function test_stop_machine_fiber(): void
96+
{
97+
assert($this->client !== null);
98+
$machine = $this->client->machines()->get('php-cbws-test1');
99+
$fiber = $machine->stop()->fiber();
100+
$fiber->start();
101+
102+
// Wait until operation has finished
103+
while (!$fiber->isTerminated()) {
104+
$fiber->resume();
105+
}
106+
107+
$operation = $fiber->getReturn();
108+
109+
if ($operation->getError() !== null) {
110+
throw $operation->getError();
111+
}
112+
self::assertTrue($operation->getDone());
113+
}
114+
115+
95116
public function test_start_machine_fiber(): void
96117
{
97118
assert($this->client !== null);

0 commit comments

Comments
 (0)