Merge pull request #8865 from ctiller/fixit3
Up timeouts for poll-cv polling strategy
This commit is contained in:
commit
38bfa15d2b
|
|
@ -33,14 +33,19 @@
|
||||||
|
|
||||||
#include "test/core/util/test_config.h"
|
#include "test/core/util/test_config.h"
|
||||||
|
|
||||||
#include <grpc/support/log.h>
|
|
||||||
#include <signal.h>
|
#include <signal.h>
|
||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
|
#include <grpc/support/alloc.h>
|
||||||
|
#include <grpc/support/log.h>
|
||||||
|
|
||||||
|
#include "src/core/lib/support/env.h"
|
||||||
#include "src/core/lib/support/string.h"
|
#include "src/core/lib/support/string.h"
|
||||||
|
|
||||||
double g_fixture_slowdown_factor = 1.0;
|
double g_fixture_slowdown_factor = 1.0;
|
||||||
|
double g_poller_slowdown_factor = 1.0;
|
||||||
|
|
||||||
#if GPR_GETPID_IN_UNISTD_H
|
#if GPR_GETPID_IN_UNISTD_H
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
|
@ -274,9 +279,16 @@ static void install_crash_handler() {}
|
||||||
|
|
||||||
void grpc_test_init(int argc, char **argv) {
|
void grpc_test_init(int argc, char **argv) {
|
||||||
install_crash_handler();
|
install_crash_handler();
|
||||||
gpr_log(GPR_DEBUG, "test slowdown: machine=%f build=%f total=%f",
|
{ /* poll-cv poll strategy runs much more slowly than anything else */
|
||||||
|
char *s = gpr_getenv("GRPC_POLL_STRATEGY");
|
||||||
|
if (s != NULL && 0 == strcmp(s, "poll-cv")) {
|
||||||
|
g_poller_slowdown_factor = 5.0;
|
||||||
|
}
|
||||||
|
gpr_free(s);
|
||||||
|
}
|
||||||
|
gpr_log(GPR_DEBUG, "test slowdown: machine=%f build=%f poll=%f total=%f",
|
||||||
(double)GRPC_TEST_SLOWDOWN_MACHINE_FACTOR,
|
(double)GRPC_TEST_SLOWDOWN_MACHINE_FACTOR,
|
||||||
(double)GRPC_TEST_SLOWDOWN_BUILD_FACTOR,
|
(double)GRPC_TEST_SLOWDOWN_BUILD_FACTOR, g_poller_slowdown_factor,
|
||||||
(double)GRPC_TEST_SLOWDOWN_FACTOR);
|
(double)GRPC_TEST_SLOWDOWN_FACTOR);
|
||||||
/* seed rng with pid, so we don't end up with the same random numbers as a
|
/* seed rng with pid, so we don't end up with the same random numbers as a
|
||||||
concurrently running test binary */
|
concurrently running test binary */
|
||||||
|
|
|
||||||
|
|
@ -49,10 +49,11 @@ extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
extern double g_fixture_slowdown_factor;
|
extern double g_fixture_slowdown_factor;
|
||||||
|
extern double g_poller_slowdown_factor;
|
||||||
|
|
||||||
#define GRPC_TEST_SLOWDOWN_FACTOR \
|
#define GRPC_TEST_SLOWDOWN_FACTOR \
|
||||||
(GRPC_TEST_SLOWDOWN_BUILD_FACTOR * GRPC_TEST_SLOWDOWN_MACHINE_FACTOR * \
|
(GRPC_TEST_SLOWDOWN_BUILD_FACTOR * GRPC_TEST_SLOWDOWN_MACHINE_FACTOR * \
|
||||||
g_fixture_slowdown_factor)
|
g_fixture_slowdown_factor * g_poller_slowdown_factor)
|
||||||
|
|
||||||
#define GRPC_TIMEOUT_SECONDS_TO_DEADLINE(x) \
|
#define GRPC_TIMEOUT_SECONDS_TO_DEADLINE(x) \
|
||||||
gpr_time_add( \
|
gpr_time_add( \
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue