BG-poll very frequently to pick up subchannels's updates in LB tests

pull/13208/head
David Garcia Quintas 7 years ago
parent 3e0769957e
commit 77827e1fb2
  1. 7
      test/cpp/end2end/client_lb_end2end_test.cc
  2. 9
      test/cpp/end2end/grpclb_end2end_test.cc
  3. 4
      test/cpp/grpclb/grpclb_test.cc

@ -36,6 +36,7 @@
extern "C" {
#include "src/core/ext/filters/client_channel/resolver/fake/fake_resolver.h"
#include "src/core/ext/filters/client_channel/subchannel_index.h"
#include "src/core/lib/support/env.h"
}
#include "src/proto/grpc/testing/echo.grpc.pb.h"
@ -86,7 +87,11 @@ class MyTestServiceImpl : public TestServiceImpl {
class ClientLbEnd2endTest : public ::testing::Test {
protected:
ClientLbEnd2endTest()
: server_host_("localhost"), kRequestMessage_("Live long and prosper.") {}
: server_host_("localhost"), kRequestMessage_("Live long and prosper.") {
// Make the backup poller poll very frequently in order to pick up
// updates from all the subchannels's FDs.
gpr_setenv("GRPC_CLIENT_CHANNEL_BACKUP_POLL_INTERVAL_MS", "1");
}
void SetUp() override {
response_generator_ = grpc_fake_resolver_response_generator_create();

@ -36,6 +36,7 @@
extern "C" {
#include "src/core/ext/filters/client_channel/resolver/fake/fake_resolver.h"
#include "src/core/lib/iomgr/sockaddr.h"
#include "src/core/lib/support/env.h"
}
#include "test/core/util/port.h"
@ -74,9 +75,9 @@ extern "C" {
using std::chrono::system_clock;
using grpc::lb::v1::LoadBalancer;
using grpc::lb::v1::LoadBalanceRequest;
using grpc::lb::v1::LoadBalanceResponse;
using grpc::lb::v1::LoadBalancer;
namespace grpc {
namespace testing {
@ -332,7 +333,11 @@ class GrpclbEnd2endTest : public ::testing::Test {
num_backends_(num_backends),
num_balancers_(num_balancers),
client_load_reporting_interval_seconds_(
client_load_reporting_interval_seconds) {}
client_load_reporting_interval_seconds) {
// Make the backup poller poll very frequently in order to pick up
// updates from all the subchannels's FDs.
gpr_setenv("GRPC_CLIENT_CHANNEL_BACKUP_POLL_INTERVAL_MS", "1");
}
void SetUp() override {
response_generator_ = grpc_fake_resolver_response_generator_create();

@ -42,6 +42,7 @@ extern "C" {
#include "src/core/lib/channel/channel_stack.h"
#include "src/core/lib/iomgr/sockaddr.h"
#include "src/core/lib/security/credentials/fake/fake_credentials.h"
#include "src/core/lib/support/env.h"
#include "src/core/lib/support/string.h"
#include "src/core/lib/support/tmpfile.h"
#include "src/core/lib/surface/channel.h"
@ -790,6 +791,9 @@ TEST(GrpclbTest, InvalidAddressInServerlist) {}
int main(int argc, char **argv) {
::testing::InitGoogleTest(&argc, argv);
grpc_test_init(argc, argv);
// Make the backup poller poll very frequently in order to pick up
// updates from all the subchannels's FDs.
gpr_setenv("GRPC_CLIENT_CHANNEL_BACKUP_POLL_INTERVAL_MS", "1");
grpc_init();
const auto result = RUN_ALL_TESTS();
grpc_shutdown();

Loading…
Cancel
Save