host = Utility::getHost(); } // Issue #636 public function test404Liveness() { $client = \OpenSearch\ClientBuilder::create() ->setHosts([$this->host]) ->setConnectionPool(\OpenSearch\ConnectionPool\StaticConnectionPool::class) ->setSSLVerification(false) ->build(); $connection = $client->transport->getConnection(); // Ensure connection is dead $connection->markDead(); // The index doesn't exist, but the server is up so this will return a 404 $this->assertFalse($client->indices()->exists(['index' => 'not_existing_index'])); // But the node should be marked as alive since the server responded $this->assertTrue($connection->isAlive()); } }