Skip to content

Commit

Permalink
Merge branch 'fix/6327' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
drew2a committed Sep 21, 2021
2 parents 164aaea + e359f5e commit a34e027
Showing 1 changed file with 15 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
)

# fmt: off

PYTEST_TIMEOUT_IN_SEC = 60

TEST_DEFAULT_TERMINATE_INTERVAL_IN_SEC = 1
TEST_DEFAULT_RETRANSMIT_INTERVAL_IN_SEC = 0.3
Expand Down Expand Up @@ -125,8 +125,11 @@ async def test_zero_transfer(self):
assert len(self.overlay(0).sent_data[self.peer(1)]) == 0
assert len(self.overlay(1).received_data[self.peer(0)]) == 0

@pytest.mark.timeout(15)
@pytest.mark.timeout(PYTEST_TIMEOUT_IN_SEC)
async def test_one_megabyte_transfer(self):
self.overlay(0).eva_protocol.terminate_by_timeout_enabled = False
self.overlay(1).eva_protocol.terminate_by_timeout_enabled = False

data_size = 1024 * 1024
data = os.urandom(1), os.urandom(data_size), random.randrange(0, 256)

Expand All @@ -137,7 +140,7 @@ async def test_one_megabyte_transfer(self):
assert len(self.overlay(1).most_recent_received_data[1]) == data_size
assert self.overlay(1).most_recent_received_data == data

@pytest.mark.timeout(15)
@pytest.mark.timeout(PYTEST_TIMEOUT_IN_SEC)
async def test_termination_by_timeout(self):
# breaks "on_data" function in community2 to make this community silent

Expand Down Expand Up @@ -232,6 +235,7 @@ async def test_size_limit(self):
assert not self.overlay(2).eva_protocol.outgoing
assert len(self.overlay(0).sent_data[self.peer(2)]) == 0

@pytest.mark.timeout(PYTEST_TIMEOUT_IN_SEC)
async def test_duplex(self):
count = 100
block_size = 10
Expand Down Expand Up @@ -262,7 +266,11 @@ async def test_duplex(self):
assert len(self.overlay(1).sent_data[self.peer(0)]) == 1
assert len(self.overlay(1).received_data[self.peer(0)]) == 1

@pytest.mark.timeout(PYTEST_TIMEOUT_IN_SEC)
async def test_multiply_send(self):
self.overlay(0).eva_protocol.terminate_by_timeout_enabled = False
self.overlay(1).eva_protocol.terminate_by_timeout_enabled = False

data_set_count = 100
data_size = 1024

Expand All @@ -275,6 +283,7 @@ async def test_multiply_send(self):
assert self.overlay(1).received_data[self.peer(0)] == data_list
assert not self.overlay(0).eva_protocol.scheduled

@pytest.mark.timeout(PYTEST_TIMEOUT_IN_SEC)
async def test_multiply_duplex(self):
data_set_count = 10

Expand Down Expand Up @@ -315,7 +324,7 @@ async def test_multiply_duplex(self):

assert data_sets_checked == 6

@pytest.mark.timeout(20)
@pytest.mark.timeout(PYTEST_TIMEOUT_IN_SEC)
async def test_survive_when_multiply_packets_lost(self):
self.overlay(0).eva_protocol.terminate_by_timeout_enabled = False
self.overlay(1).eva_protocol.terminate_by_timeout_enabled = False
Expand Down Expand Up @@ -371,7 +380,7 @@ async def fake_on_data1(peer, payload):
assert len(self.overlay(1).received_data[self.peer(0)]) == data_set_count
assert self.overlay(1).received_data[self.peer(0)] == data

@pytest.mark.timeout(15)
@pytest.mark.timeout(PYTEST_TIMEOUT_IN_SEC)
async def test_dynamically_changed_window_size(self):
window_size = 5

Expand Down Expand Up @@ -427,7 +436,7 @@ def fake_on_acknowledgement0(peer, payload):
assert isinstance(self.overlay(0).most_recent_received_exception, TransferException)
assert isinstance(self.overlay(1).most_recent_received_exception, SizeLimitException)

@pytest.mark.timeout(10)
@pytest.mark.timeout(PYTEST_TIMEOUT_IN_SEC)
async def test_wrong_message_order_and_wrong_nonce(self):
self.overlay(0).eva_protocol.terminate_by_timeout_enabled = False
self.overlay(1).eva_protocol.terminate_by_timeout_enabled = False
Expand Down

0 comments on commit a34e027

Please sign in to comment.