Test that queries and clients can be registered and deregistered with the reservation trackers and the buffer pool.
| 536 | /// Test that queries and clients can be registered and deregistered with the reservation |
| 537 | /// trackers and the buffer pool. |
| 538 | TEST_F(BufferPoolTest, BasicRegistration) { |
| 539 | int num_concurrent_queries = 1024; |
| 540 | int64_t sum_initial_reservations = 4; |
| 541 | int64_t reservation_limit = 1024; |
| 542 | // Need enough buffers for all initial reservations. |
| 543 | int64_t total_mem = sum_initial_reservations * num_concurrent_queries; |
| 544 | global_reservations_.InitRootTracker(NewProfile(), total_mem); |
| 545 | |
| 546 | BufferPool pool(test_env_->metrics(), TEST_BUFFER_LEN, total_mem, total_mem); |
| 547 | |
| 548 | RegisterQueriesAndClients(&pool, 0, num_concurrent_queries, sum_initial_reservations, |
| 549 | reservation_limit, &rng_); |
| 550 | |
| 551 | ASSERT_EQ(global_reservations_.GetUsedReservation(), 0); |
| 552 | ASSERT_EQ(global_reservations_.GetChildReservations(), 0); |
| 553 | ASSERT_EQ(global_reservations_.GetReservation(), 0); |
| 554 | global_reservations_.Close(); |
| 555 | } |
| 556 | |
| 557 | /// Test that queries and clients can be registered and deregistered by concurrent |
| 558 | /// threads. |
nothing calls this directly
no test coverage detected