Helper function for the SimultaneousMultipleQueriesOneSession test. Intended to be run as part of a separate thread.
| 473 | // Helper function for the SimultaneousMultipleQueriesOneSession test. Intended to be run |
| 474 | // as part of a separate thread. |
| 475 | void runTestQueries(const int thread_num, InternalServer* server, |
| 476 | const DatabaseTest* const db_test, const TUniqueId* session_id) { |
| 477 | const int queries_to_run = 100; |
| 478 | |
| 479 | TUniqueId query_id; |
| 480 | |
| 481 | for (int i=0; i<queries_to_run; i++) { |
| 482 | int cat = i % db_test->GetCategoryCount(); |
| 483 | ASSERT_OK(server->SubmitQuery(StrCat("select * from ", db_test->GetTableName(), |
| 484 | " where category=", cat, " --thread '", thread_num, "' query '", i, "'"), |
| 485 | *session_id, query_id)); |
| 486 | ASSERT_OK(server->WaitForResults(query_id)); |
| 487 | server->CloseQuery(query_id); |
| 488 | |
| 489 | assertQueryState(query_id, QUERY_STATE_SUCCESS); |
| 490 | } |
| 491 | } // runTestQueries |
| 492 | |
| 493 | TEST(InternalServerTest, SimultaneousMultipleQueriesOneSession) { |
| 494 | const int test_threads = 10; |
nothing calls this directly
no test coverage detected