diff --git a/tests/test_http_std_net.py b/tests/test_http_std_net.py index c0cdf2a4196..ced7103775a 100644 --- a/tests/test_http_std_net.py +++ b/tests/test_http_std_net.py @@ -20,7 +20,6 @@ import typing import json -from edb import errors from edb.testbase import http as tb @@ -100,34 +99,30 @@ async def test_http_std_net_con_schedule_request_get_01(self): ) ) - async for tr in self.try_until_succeeds( - delay=2, timeout=120, ignore=(errors.TransactionSerializationError,) - ): - async with tr: - result = await self.con.query_single( - """ - with - nh as module std::net::http, - net as module std::net, - url := $url, - request := ( - insert nh::ScheduledRequest { - created_at := datetime_of_statement(), - updated_at := datetime_of_statement(), - state := std::net::RequestState.Pending, + result = await self.con.query_single( + """ + with + nh as module std::net::http, + net as module std::net, + url := $url, + request := ( + insert nh::ScheduledRequest { + created_at := datetime_of_statement(), + updated_at := datetime_of_statement(), + state := std::net::RequestState.Pending, - url := url, - method := nh::Method.`GET`, - headers := [ - ("Accept", "application/json"), - ("x-test-header", "test-value"), - ], - } - ) - select request {*}; - """, - url=url, + url := url, + method := nh::Method.`GET`, + headers := [ + ("Accept", "application/json"), + ("x-test-header", "test-value"), + ], + } ) + select request {*}; + """, + url=url, + ) requests_for_example = None async for tr in self.try_until_succeeds( @@ -177,32 +172,29 @@ async def test_http_std_net_con_schedule_request_post_01(self): ) ) - async for tr in self.try_until_succeeds( - delay=2, timeout=120, ignore=(errors.TransactionSerializationError,) - ): - async with tr: - result = await self.con.query_single( - """ - with - nh as module std::net::http, - url := $url, - body := $body, - request := ( - nh::schedule_request( - url, - method := nh::Method.POST, - headers := [ - ("Accept", "application/json"), - ("x-test-header", "test-value"), - ], - body := body, - ) - ) - select request {*}; - """, - url=url, - body=b"Hello, world!", + result = await self.con.query_single( + """ + with + nh as module std::net::http, + net as module std::net, + url := $url, + body := $body, + request := ( + nh::schedule_request( + url, + method := nh::Method.POST, + headers := [ + ("Accept", "application/json"), + ("x-test-header", "test-value"), + ], + body := body, + ) ) + select request {*}; + """, + url=url, + body=b"Hello, world!", + ) requests_for_example = None async for tr in self.try_until_succeeds( @@ -236,27 +228,26 @@ async def test_http_std_net_con_schedule_request_bad_address(self): # Test a request to a known-bad address bad_url = "http://256.256.256.256" - async for tr in self.try_until_succeeds( - delay=2, timeout=120, ignore=(errors.TransactionSerializationError,) - ): - async with tr: - result = await self.con.query_single( - """ - with - nh as module std::net::http, - url := $url, - request := ( - nh::schedule_request(url) - ) - select request { - id, - state, - failure, - response, - }; - """, - url=bad_url, + result = await self.con.query_single( + """ + with + nh as module std::net::http, + url := $url, + request := ( + nh::schedule_request( + url, + method := nh::Method.`GET` + ) ) + select request { + id, + state, + failure, + response, + }; + """, + url=bad_url, + ) table_result = await self._wait_for_request_completion(result.id) self.assertEqual(str(table_result.state), 'Failed')