From 6e9688743c15dcf61fa67848b8a7df9c74d5960a Mon Sep 17 00:00:00 2001 From: qkdreyer Date: Mon, 15 Jul 2024 16:48:56 +0200 Subject: [PATCH] test: fix controller_id --- tests/controller_id.phpt | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/tests/controller_id.phpt b/tests/controller_id.phpt index 19a14714..10ec2ddc 100644 --- a/tests/controller_id.phpt +++ b/tests/controller_id.phpt @@ -9,22 +9,16 @@ RD_KAFKA_BUILD_VERSION < 0x000b0500 && die("skip librdkafka < 0.11.5"); require __DIR__ . '/integration-tests-check.php'; $conf = new RdKafka\Conf(); -if (RD_KAFKA_VERSION >= 0x090000 && false !== getenv('TEST_KAFKA_BROKER_VERSION')) { - $conf->set('broker.version.fallback', getenv('TEST_KAFKA_BROKER_VERSION')); -} $conf->set('metadata.broker.list', getenv('TEST_KAFKA_BROKERS')); -$conf->setDrMsgCb(function ($rdkafka, $msg) { - var_dump($rdkafka, $msg); -}); +echo (new RdKafka\Producer($conf))->getControllerId(0) . \PHP_EOL; +echo (new RdKafka\Consumer($conf))->getControllerId(0) . \PHP_EOL; -$producer = new RdKafka\Producer($conf); -$consumer = new RdKafka\Consumer($conf); -$kafkaConsumer = new RdKafka\KafkaConsumer($conf); +$conf = new RdKafka\Conf(); +$conf->set('metadata.broker.list', getenv('TEST_KAFKA_BROKERS')); +$conf->set('group.id', 'test'); -echo $producer->getControllerId() . \PHP_EOL; -echo $consumer->getControllerId() . \PHP_EOL; -echo $kafkaConsumer->getControllerId() . \PHP_EOL; +echo (new RdKafka\KafkaConsumer($conf))->getControllerId(0) . \PHP_EOL; --EXPECT-- 1 1