Fix test failure in TestQueryService