Skip to content

Commit

Permalink
Revert "Add retries to std::net tests (#7898)"
Browse files Browse the repository at this point in the history
This reverts commit a27ff6a.
  • Loading branch information
msullivan committed Oct 22, 2024
1 parent a131a2b commit 5950686
Showing 1 changed file with 63 additions and 72 deletions.
135 changes: 63 additions & 72 deletions tests/test_http_std_net.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
import typing
import json

from edb import errors
from edb.testbase import http as tb


Expand Down Expand Up @@ -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 := <str>$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 := <str>$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(
Expand Down Expand Up @@ -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 := <str>$url,
body := <bytes>$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 := <str>$url,
body := <bytes>$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(
Expand Down Expand Up @@ -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 := <str>$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 := <str>$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')
Expand Down

0 comments on commit 5950686

Please sign in to comment.