Skip to content

Commit

Permalink
#229 - Test trueval agent batch.py gets stuck in infinite loop (#367)
Browse files Browse the repository at this point in the history
* Enable logs

* Unskip tests and add logging

* Enable fixture, update arg

* Patch wait function

* Remove prints and update fixture

* Don't print test logs
  • Loading branch information
trizin authored Nov 22, 2023
1 parent 0d9fe5f commit 76a225e
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions pdr_backend/trueval/test/test_trueval_agent_batch.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,12 @@
from pdr_backend.util.constants import ZERO_ADDRESS


@pytest.mark.skip("reason=avoid hangs, until #229 fixed")
def test_new_agent(trueval_config):
agent_ = TruevalAgentBatch(trueval_config, get_trueval, ZERO_ADDRESS)
assert agent_.config == trueval_config
assert agent_.predictoor_batcher.contract_address == ZERO_ADDRESS


@pytest.mark.skip("reason=avoid hangs, until #229 fixed")
def test_process_trueval_slot_up(
agent, slot, predictoor_contract_mock
): # pylint: disable=unused-argument
Expand All @@ -27,7 +25,6 @@ def test_process_trueval_slot_up(
assert slot.trueval


@pytest.mark.skip("reason=avoid hangs, until #229 fixed")
def test_process_trueval_slot_down(
agent, slot, predictoor_contract_mock
): # pylint: disable=unused-argument
Expand All @@ -39,7 +36,6 @@ def test_process_trueval_slot_down(
assert not slot.trueval


@pytest.mark.skip("reason=avoid hangs, until #229 fixed")
def test_process_trueval_slot_cancel(
agent, slot, predictoor_contract_mock
): # pylint: disable=unused-argument
Expand All @@ -51,7 +47,6 @@ def test_process_trueval_slot_cancel(
assert not slot.trueval


@pytest.mark.skip("reason=avoid hangs, until #229 fixed")
def test_batch_submit_truevals(agent, slot):
times = 3
slot.feed.address = "0x0000000000000000000000000000000000c0ffee"
Expand Down Expand Up @@ -91,9 +86,10 @@ def test_batch_submit_truevals(agent, slot):
mock.assert_called_with(contract_addrs, epoch_starts, truevals, cancels, True)


@pytest.mark.skip("reason=avoid hangs, until #229 fixed")
def test_take_step(agent, slot):
with patch.object(
with patch(
"pdr_backend.trueval.trueval_agent_batch.wait_until_subgraph_syncs"
), patch.object(
agent, "get_batch", return_value=[slot]
) as mock_get_batch, patch.object(
agent, "process_trueval_slot"
Expand Down

0 comments on commit 76a225e

Please sign in to comment.