aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/core/statistics
diff options
context:
space:
mode:
authorGravatar Craig Tiller <ctiller@google.com>2015-07-13 08:41:49 -0700
committerGravatar Craig Tiller <ctiller@google.com>2015-07-13 08:41:49 -0700
commit143e7bf0cfcbfd60422f4e8f15e6b5c18259c8cd (patch)
treecbeb3f4da486b08a6cdae1be6754c523e2a361fb /test/core/statistics
parentf0fb537da9e67902f56b50d3d0f516b295609d88 (diff)
Introduce a clock type field onto gpr_timespec.
Use it to validate that arithmetic on time types makes even some vague kind of sense.
Diffstat (limited to 'test/core/statistics')
-rw-r--r--test/core/statistics/census_log_tests.c4
-rw-r--r--test/core/statistics/trace_test.c2
-rw-r--r--test/core/statistics/window_stats_test.c4
3 files changed, 5 insertions, 5 deletions
diff --git a/test/core/statistics/census_log_tests.c b/test/core/statistics/census_log_tests.c
index a34dcf07c4..0f326d28e2 100644
--- a/test/core/statistics/census_log_tests.c
+++ b/test/core/statistics/census_log_tests.c
@@ -310,7 +310,7 @@ static void multiple_writers_single_reader(int circular_log) {
/* Wait for writers to finish. */
gpr_mu_lock(&writers_mu);
while (writers_count != 0) {
- gpr_cv_wait(&writers_done, &writers_mu, gpr_inf_future);
+ gpr_cv_wait(&writers_done, &writers_mu, gpr_inf_future(GPR_CLOCK_REALTIME));
}
gpr_mu_unlock(&writers_mu);
gpr_mu_destroy(&writers_mu);
@@ -323,7 +323,7 @@ static void multiple_writers_single_reader(int circular_log) {
}
/* wait for reader to finish */
while (reader.running) {
- gpr_cv_wait(&reader_done, &reader_mu, gpr_inf_future);
+ gpr_cv_wait(&reader_done, &reader_mu, gpr_inf_future(GPR_CLOCK_REALTIME));
}
if (circular_log) {
/* Assert that there were no out-of-space errors. */
diff --git a/test/core/statistics/trace_test.c b/test/core/statistics/trace_test.c
index b13fd03f70..187884d90f 100644
--- a/test/core/statistics/trace_test.c
+++ b/test/core/statistics/trace_test.c
@@ -136,7 +136,7 @@ static void test_concurrency(void) {
gpr_mu_lock(&arg.mu);
while (arg.num_done < NUM_THREADS) {
gpr_log(GPR_INFO, "num done %d", arg.num_done);
- gpr_cv_wait(&arg.done, &arg.mu, gpr_inf_future);
+ gpr_cv_wait(&arg.done, &arg.mu, gpr_inf_future(GPR_CLOCK_REALTIME));
}
gpr_mu_unlock(&arg.mu);
census_tracing_shutdown();
diff --git a/test/core/statistics/window_stats_test.c b/test/core/statistics/window_stats_test.c
index 1c66a87407..9e637ccce9 100644
--- a/test/core/statistics/window_stats_test.c
+++ b/test/core/statistics/window_stats_test.c
@@ -290,8 +290,8 @@ void infinite_interval_test(void) {
int i;
const int count = 100000;
gpr_timespec increment = {0, 0};
- struct census_window_stats* stats =
- census_window_stats_create(1, &gpr_inf_future, 10, &kMyStatInfo);
+ struct census_window_stats* stats = census_window_stats_create(
+ 1, &gpr_inf_future(GPR_CLOCK_REALTIME), 10, &kMyStatInfo);
srand(gpr_now(GPR_CLOCK_REALTIME).tv_nsec);
for (i = 0; i < count; i++) {
increment.tv_sec = rand() % 21600; /* 6 hours */