Merge pull request #17925 from vjpai/oops

Fix a test broken for 3 years....
pull/17928/head
Vijay Pai 6 years ago committed by GitHub
commit 588d33d1df
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 6
      test/core/iomgr/timer_heap_test.cc

@ -164,13 +164,13 @@ static void test2(void) {
size_t num_inserted = 0;
grpc_timer_heap_init(&pq);
memset(elems, 0, elems_size);
memset(elems, 0, elems_size * sizeof(elems[0]));
for (size_t round = 0; round < 10000; round++) {
int r = rand() % 1000;
if (r <= 550) {
/* 55% of the time we try to add something */
elem_struct* el = search_elems(elems, GPR_ARRAY_SIZE(elems), false);
elem_struct* el = search_elems(elems, elems_size, false);
if (el != nullptr) {
el->elem.deadline = random_deadline();
grpc_timer_heap_add(&pq, &el->elem);
@ -180,7 +180,7 @@ static void test2(void) {
}
} else if (r <= 650) {
/* 10% of the time we try to remove something */
elem_struct* el = search_elems(elems, GPR_ARRAY_SIZE(elems), true);
elem_struct* el = search_elems(elems, elems_size, true);
if (el != nullptr) {
grpc_timer_heap_remove(&pq, &el->elem);
el->inserted = false;

Loading…
Cancel
Save