test: Fix integration tests (#3072)

Fix 2 issues in integration tests:
- `127.0.0.2` is forwarded to localhost on macos
- Keyspace is always dropped in test's destructor but it may not exist
This commit is contained in:
Sergey Kuznetsov
2026-05-12 13:49:39 +01:00
committed by GitHub
parent a1112bf318
commit d056c72212
2 changed files with 3 additions and 3 deletions

View File

@@ -81,7 +81,7 @@ public:
// drop the keyspace for next test
data::cassandra::Handle const handle{TestGlobals::instance().backendHost};
EXPECT_TRUE(handle.connect());
EXPECT_TRUE(handle.execute("DROP KEYSPACE " + std::string{kKEYSPACE}));
EXPECT_TRUE(handle.execute("DROP KEYSPACE IF EXISTS " + std::string{kKEYSPACE}));
}
};
@@ -98,7 +98,7 @@ TEST_F(BackendCassandraFactoryTest, CreateCassandraBackendDBDisconnect)
{"database": {
"type": "cassandra",
"cassandra": {
"contact_points": "127.0.0.2"
"contact_points": "128.0.2.1"
}
}}
)JSON");

View File

@@ -111,7 +111,7 @@ TEST_F(BackendCassandraBaseTest, ConnectionFailTimeout)
Settings settings;
settings.connectionTimeout = std::chrono::milliseconds{30};
settings.connectionInfo =
Settings::ContactPoints{.contactPoints = "127.0.0.2", .port = std::nullopt};
Settings::ContactPoints{.contactPoints = "128.0.2.1", .port = std::nullopt};
Handle const handle{settings};
auto const f = handle.asyncConnect();