8000 Sync auto batching requests by leszekhanusz · Pull Request #436 · graphql-python/gql · GitHub
[go: up one dir, main page]

Skip to content
8000

Sync auto batching requests #436

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 11 commits into from
Sep 13, 2023
Prev Previous commit
Add thread.join to tests
  • Loading branch information
leszekhanusz committed Sep 11, 2023
commit 02f249e23d4d12b1a080280d16d0b1e0165b93af
8 changes: 8 additions & 0 deletions tests/test_requests_batch.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,8 @@ async def handler(request):
def test_code():
transport = RequestsHTTPTransport(url=url)

threads = []

with Client(
transport=transport,
batch_interval=0.01,
Expand All @@ -187,6 +189,10 @@ def test_thread():
for _ in range(2):
thread = Thread(target=test_thread)
thread.start()
threads.append(thread)

for thread in threads:
thread.join()

await run_sync_test(event_loop, server, test_code)

Expand Down Expand Up @@ -581,6 +587,7 @@ def get_continent_name(session, continent_code):
),
)
thread.start()
thread.join()

# Doing it twice to check that everything is closing and reconnecting correctly
with client as session:
Expand All @@ -595,6 +602,7 @@ def get_continent_name(session, continent_code):
),
)
thread.start()
thread.join()


@pytest.mark.online
Expand Down
0