Attempt to mark this test as flaky.
@@ -13,6 +13,7 @@ from parlai.mturk.core.socket_manager import Packet, SocketManager
from parlai.mturk.core.agents import AssignState
from parlai.mturk.core.mturk_manager import MTurkManager
from parlai.core.params import ParlaiParser
+import parlai.core.testing_utils as testing_utils
import parlai.mturk.core.mturk_manager as MTurkManagerFile
import parlai.mturk.core.data_model as data_model
@@ -567,6 +568,7 @@ class TestMTurkManagerWorkflows(unittest.TestCase):
[x for x in manager.socket_manager.run.values() if not x]
), 2, 2)
+ @testing_utils.retry(ntries=3)
def test_expire_onboarding(self):
manager = self.mturk_manager
@@ -574,7 +576,7 @@ class TestMTurkManagerWorkflows(unittest.TestCase):
agent_1 = self.agent_1
self.alive_agent(agent_1)
assert_equal_by(
- lambda: agent_1.worker_id in self.onboarding_agents, True, 2)
+ lambda: agent_1.worker_id in self.onboarding_agents, True, 5)
agent_1_object = manager.worker_manager.get_agent_for_assignment(
agent_1.assignment_id)
self.assertFalse(self.onboarding_agents[agent_1.worker_id])
@@ -588,12 +590,12 @@ class TestMTurkManagerWorkflows(unittest.TestCase):
assert_equal_by(lambda: len(
[p for p in agent_1.message_packet
if p.data['text'] == data_model.COMMAND_EXPIRE_HIT]
- ), 1, 2)
+ ), 1, 5)
# Assert sockets are closed
assert_equal_by(lambda: len(
[x for x in manager.socket_manager.run.values() if not x]
- ), 1, 2)
+ ), 1, 5)
def test_reconnect_complete(self):
manager = self.mturk_manager
