Skip to content

Commit 06d52a0

Browse files
committed
account for loading times in some tests
1 parent 9546b45 commit 06d52a0

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

tests/core/contracts/test_contract_init.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ def test_init_multiple_contracts_performance(w3, emitter_contract_data):
8585
abi=emitter_contract_data["abi"], bytecode=emitter_contract_data["bytecode"]
8686
)
8787
# assert initializing 500 contracts is within a conservative / reasonable time
88-
assert (time.time() - start_time) < 1.75
88+
assert (time.time() - start_time) < 3
8989

9090

9191
# -- async -- #
@@ -98,4 +98,4 @@ def test_async_init_multiple_contracts_performance(async_w3, emitter_contract_da
9898
abi=emitter_contract_data["abi"], bytecode=emitter_contract_data["bytecode"]
9999
)
100100
# assert initializing 500 contracts is within a conservative / reasonable time
101-
assert (time.time() - start_time) < 1.75
101+
assert (time.time() - start_time) < 3

tests/core/utilities/test_http_session_manager.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ def _simulate_call(http_session_manager, uri):
8787
return _session
8888

8989

90-
@pytest.fixture(scope="function")
90+
@pytest.fixture
9191
def http_session_manager():
9292
return HTTPSessionManager()
9393

@@ -485,7 +485,7 @@ def target_function(endpoint_uri):
485485
event_loop = asyncio.new_event_loop()
486486
unique_session = event_loop.run_until_complete(
487487
http_session_manager.async_cache_and_return_session(
488-
endpoint_uri, request_timeout=ClientTimeout(0.01)
488+
endpoint_uri, request_timeout=ClientTimeout(0.1)
489489
)
490490
)
491491
event_loop.close()
@@ -500,6 +500,7 @@ def target_function(endpoint_uri):
500500
daemon=True,
501501
)
502502
thread.start()
503+
time.sleep(0.01)
503504
threads.append(thread)
504505

505506
[thread.join() for thread in threads]

0 commit comments

Comments
 (0)