From 3fd82e143a3770243732d9ec96ace4e4681d0d27 Mon Sep 17 00:00:00 2001 From: Lars Strojny Date: Thu, 6 Jul 2023 00:25:44 +0200 Subject: [PATCH] =?UTF-8?q?Don=E2=80=99t=20catch=20exceptions=20anymore?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../tests/Integration/MongoDBInstrumentationTest.php | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/Instrumentation/MongoDB/tests/Integration/MongoDBInstrumentationTest.php b/src/Instrumentation/MongoDB/tests/Integration/MongoDBInstrumentationTest.php index 084e465b..5dfbd912 100644 --- a/src/Instrumentation/MongoDB/tests/Integration/MongoDBInstrumentationTest.php +++ b/src/Instrumentation/MongoDB/tests/Integration/MongoDBInstrumentationTest.php @@ -5,8 +5,6 @@ namespace OpenTelemetry\Tests\Instrumentation\MongoDB\tests\Integration; use ArrayObject; -use MongoDB\Driver\Exception\ConnectionException; -use MongoDB\Driver\Exception\ServerException; use MongoDB\Driver\Manager; use MongoDB\Operation\FindOne; use OpenTelemetry\API\Instrumentation\Configurator; @@ -51,14 +49,11 @@ public function tearDown(): void public function test_mongodb_find_one(): void { - $manager = new Manager(); + $manager = new Manager('mongodb://127.0.0.1:27017'); $find = new FindOne(self::DATABASE_NAME, self::COLLECTION_NAME, ['a' => 'b']); - try { - $find->execute($manager->selectServer()); - } catch (ServerException|ConnectionException $e) { - } + $find->execute($manager->selectServer()); $this->assertCount(1, $this->storage); $this->span = $this->storage->offsetGet(0);