Skip to content

Commit 3c974e3

Browse files
committed
fix test setup
1 parent 991b8ef commit 3c974e3

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/Symfony/Component/Messenger/Bridge/Redis/Tests/Transport/ConnectionTest.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -412,18 +412,18 @@ public function testInvalidSentinelMasterName()
412412
$this->markTestSkipped('REDIS_SENTINEL_HOSTS env var is not defined.');
413413
}
414414

415+
if (!getenv('MESSENGER_REDIS_SENTINEL_MASTER')) {
416+
self::markTestSkipped('Redis sentinel is not configured');
417+
}
418+
415419
$dsn = 'redis:?host['.str_replace(' ', ']&host[', $hosts).']';
416420

417421
try {
418-
Connection::fromDsn($dsn, ['delete_after_ack' => true]);
422+
Connection::fromDsn($dsn, ['delete_after_ack' => true, 'sentinel_master' => getenv('MESSENGER_REDIS_SENTINEL_MASTER')]);
419423
} catch (\Exception $e) {
420424
self::markTestSkipped($e->getMessage());
421425
}
422426

423-
if (!getenv('MESSENGER_REDIS_SENTINEL_MASTER')) {
424-
self::markTestSkipped('Redis sentinel is not configured');
425-
}
426-
427427
$uid = uniqid('sentinel_', true);
428428

429429
$this->expectException(\InvalidArgumentException::class);

0 commit comments

Comments
 (0)