1010use Amp \Postgres \TransactionError ;
1111use Amp \Postgres \TupleResult ;
1212use PHPUnit \Framework \TestCase ;
13- use function Amp \asyncCall ;
1413
1514abstract 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