Merge pull request #13208 from dgquintas/lb_poll2

Make the BG poller poll very frequently in LB tests
reviewable/pr13068/r7
David G. Quintas 7 years ago committed by GitHub
commit e1d91cfd58
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 11
      build.yaml
  2. 7
      test/cpp/end2end/client_lb_end2end_test.cc
  3. 9
      test/cpp/end2end/grpclb_end2end_test.cc
  4. 4
      test/cpp/grpclb/grpclb_test.cc
  5. 14
      tools/run_tests/generated/tests.json

@ -3879,10 +3879,6 @@ targets:
- grpc
- gpr_test_util
- gpr
excluded_poll_engines:
- poll
- poll-cv
- epollex
- name: codegen_test_full
gtest: true
build: test
@ -4171,9 +4167,6 @@ targets:
- grpc
- gpr_test_util
- gpr
excluded_poll_engines:
- poll
- poll-cv
- name: grpclb_test
gtest: false
build: test
@ -4188,10 +4181,6 @@ targets:
- grpc
- gpr_test_util
- gpr
excluded_poll_engines:
- poll
- poll-cv
- epollex
- name: h2_ssl_cert_test
gtest: true
build: test

@ -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();

@ -3427,11 +3427,6 @@
"cpu_cost": 1.0,
"exclude_configs": [],
"exclude_iomgrs": [],
"excluded_poll_engines": [
"poll",
"poll-cv",
"epollex"
],
"flaky": false,
"gtest": true,
"language": "c++",
@ -3794,10 +3789,6 @@
"cpu_cost": 1.0,
"exclude_configs": [],
"exclude_iomgrs": [],
"excluded_poll_engines": [
"poll",
"poll-cv"
],
"flaky": false,
"gtest": true,
"language": "c++",
@ -3822,11 +3813,6 @@
"cpu_cost": 1.0,
"exclude_configs": [],
"exclude_iomgrs": [],
"excluded_poll_engines": [
"poll",
"poll-cv",
"epollex"
],
"flaky": false,
"gtest": false,
"language": "c++",

Loading…
Cancel
Save