Skip to content

Commit 94845ff

Browse files
committed
Improve test name and documentation
1 parent c09c92e commit 94845ff

File tree

1 file changed

+19
-3
lines changed

1 file changed

+19
-3
lines changed

tests/lb_pool_test.cpp

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,12 @@ extern set<string> sent_up_lb_nodes;
3030

3131
class LbPoolTest : public TesttoolTest {};
3232

33-
TEST_F(LbPoolTest, InitDown) {
33+
TEST_F(LbPoolTest, InitDownWithHCs) {
3434
// On startup LB Nodes are read as down from pfctl.
3535
SetUp(false);
3636

37-
// And they are still down once testtool starts.
37+
// And they are still down once testtool starts, because they have HCs
38+
// and the HCs must run before testool can take action.
3839
EXPECT_EQ(UpNodesNames(), set<string>({}));
3940
}
4041

@@ -49,9 +50,24 @@ TEST_F(LbPoolTest, InitDownNoHCs) {
4950
EXPECT_EQ(UpNodesNames(), set<string>({"lbnode1", "lbnode2", "lbnode3"}));
5051
}
5152

52-
TEST_F(LbPoolTest, InitUp) {
53+
TEST_F(LbPoolTest, InitUpWithHCs) {
54+
// On startup LB Nodes are read as up from pfctl.
5355
SetUp(true);
56+
57+
// And they are still up once testtool starts, because they have HCs
58+
// and the HCs must run before testool can take action.
59+
EXPECT_EQ(UpNodesNames(), set<string>({"lbnode1", "lbnode2", "lbnode3"}));
60+
}
61+
62+
TEST_F(LbPoolTest, InitUpNoHCs) {
63+
// The LB Pool has no HCs.
64+
base_config["lbpool.example.com"].erase("health_checks");
65+
5466
// On startup LB Nodes are read as up from pfctl.
67+
SetUp(true);
68+
69+
// And they are kept active, they only might be changed later if after
70+
// HCs would run.
5571
EXPECT_EQ(UpNodesNames(), set<string>({"lbnode1", "lbnode2", "lbnode3"}));
5672
}
5773

0 commit comments

Comments
 (0)