Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
joedixon committed Jan 20, 2025
1 parent 6a2d190 commit ed1f733
Showing 1 changed file with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
use Laravel\Reverb\Servers\Reverb\Contracts\PubSubIncomingMessageHandler;
use Laravel\Reverb\Servers\Reverb\Publishing\RedisClientFactory;
use Laravel\Reverb\Servers\Reverb\Publishing\RedisPubSubProvider;
use React\EventLoop\Factory;
use React\EventLoop\Loop;
use React\EventLoop\LoopInterface;
use React\Promise\Promise;

Expand Down Expand Up @@ -70,7 +70,7 @@

it('can timeout and fail when unable to reconnect', function () {
$clientFactory = Mockery::mock(RedisClientFactory::class);
$loop = Factory::create();
$loop = Loop::get();

// Publisher client
$clientFactory->shouldReceive('make')
Expand All @@ -84,7 +84,6 @@

$provider = new RedisPubSubProvider($clientFactory, Mockery::mock(PubSubIncomingMessageHandler::class), 'reverb', ['host' => 'localhost', 'port' => 6379, 'timeout' => 1]);
$provider->connect($loop);

$loop->run();
})->throws(Exception::class, 'Failed to reconnect to Redis connection [publisher] within 1 second limit')->skip();

Expand Down Expand Up @@ -147,7 +146,7 @@

it('does not attempt to reconnect after a controlled disconnection', function () {
$clientFactory = Mockery::mock(RedisClientFactory::class);
$loop = Factory::create();
$loop = Loop::get();

// Publisher client
$clientFactory->shouldReceive('make')
Expand All @@ -157,4 +156,4 @@
$provider = new RedisPubSubProvider($clientFactory, Mockery::mock(PubSubIncomingMessageHandler::class), 'reverb');
$loop->addTimer(1, fn () => $provider->disconnect());
$provider->connect($loop);
})->skip();
});

0 comments on commit ed1f733

Please sign in to comment.