Skip to content

Commit 60d57ad

Browse files
committed
Delay notifications
1 parent 202c591 commit 60d57ad

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

test/AbstractConnectionTest.php

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
use Amp\Postgres\TransactionError;
1111
use Amp\Postgres\TupleResult;
1212
use PHPUnit\Framework\TestCase;
13-
use function Amp\asyncCall;
1413

1514
abstract class AbstractConnectionTest extends TestCase {
1615
/** @var \Amp\Postgres\Connection */
@@ -192,13 +191,13 @@ public function testListen() {
192191

193192
$this->assertInstanceOf(Listener::class, $listener);
194193

195-
asyncCall(function () use ($channel) {
194+
Loop::delay(100, function () use ($channel) {
196195
yield $this->connection->query(\sprintf("NOTIFY %s, '%s'", $channel, '0'));
197196
yield $this->connection->query(\sprintf("NOTIFY %s, '%s'", $channel, '1'));
198197
});
199198

200199
$count = 0;
201-
Loop::delay(100, function () use ($listener) {
200+
Loop::delay(200, function () use ($listener) {
202201
$listener->unlisten();
203202
});
204203

@@ -219,13 +218,13 @@ public function testNotify() {
219218
/** @var \Amp\Postgres\Listener $listener */
220219
$listener = yield $this->connection->listen($channel);
221220

222-
asyncCall(function () use ($channel) {
221+
Loop::delay(100, function () use ($channel) {
223222
yield $this->connection->notify($channel, '0');
224223
yield $this->connection->notify($channel, '1');
225224
});
226225

227226
$count = 0;
228-
Loop::delay(100, function () use ($listener) {
227+
Loop::delay(200, function () use ($listener) {
229228
$listener->unlisten();
230229
});
231230

0 commit comments

Comments
 (0)