Skip to content

Commit 38a36f7

Browse files
author
Michael Penick
committed
Use cpp-driver.hostname. instead of localhost in name resolver tests
1 parent e89f14d commit 38a36f7

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

tests/src/unit/tests/test_name_resolver.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ class NameResolverUnitTest : public LoopTest {
5454
};
5555

5656
TEST_F(NameResolverUnitTest, Simple) {
57-
NameResolver::Ptr resolver(create(Address("127.0.0.1", 9042)));
57+
NameResolver::Ptr resolver(create(Address("127.254.254.254", 9042)));
5858
resolver->resolve(loop(), RESOLVE_TIMEOUT);
5959
run_loop();
6060
ASSERT_EQ(NameResolver::SUCCESS, status());
@@ -63,12 +63,12 @@ TEST_F(NameResolverUnitTest, Simple) {
6363
gethostname(win_hostname, 64);
6464
EXPECT_EQ(String(win_hostname), hostname());
6565
#else
66-
EXPECT_EQ("localhost", hostname());
66+
EXPECT_EQ("cpp-driver.hostname.", hostname());
6767
#endif
6868
}
6969

7070
TEST_F(NameResolverUnitTest, Timeout) {
71-
NameResolver::Ptr resolver(create(Address("127.0.0.1", 9042)));
71+
NameResolver::Ptr resolver(create(Address("127.254.254.254", 9042)));
7272

7373
// Libuv's address resolver uses the uv_work thread pool to handle resolution
7474
// asynchronously. If we starve all the threads in the uv_work thread pool
@@ -91,7 +91,7 @@ TEST_F(NameResolverUnitTest, Invalid) {
9191
}
9292

9393
TEST_F(NameResolverUnitTest, Cancel) {
94-
NameResolver::Ptr resolver(create(Address("127.0.0.1", 9042)));
94+
NameResolver::Ptr resolver(create(Address("127.254.254.254", 9042)));
9595
resolver->resolve(loop(), RESOLVE_TIMEOUT);
9696
resolver->cancel();
9797
run_loop();

0 commit comments

Comments
 (0)