class_docstr: Basic tests on the util functions in TorchAgent.
class_docstr_tok: ["Basic","tests","on","the","util","functions","in","TorchAgent","."]
docstr: Emulate a setting where batch_act misappropriately handles mturk.
docstr_tok: ["Emulate","a","setting","where","batch_act","misappropriately","handles","mturk","."]
code: def test_mturk_racehistory(self):
      """
      Emulate a setting where batch_act misappropriately handles mturk.
      """
      agent = get_agent(batchsize=16, interactive_mode=True, echo=True)
      share1 = create_agent_from_shared(agent.share())
  
      share1.observe(
          Message({"text": "thread1-msg1", "episode_done": False})
      )
      share2 = create_agent_from_shared(agent.share())
      share2.observe(
          Message({"text": "thread2-msg1", "episode_done": False})
      )
      share1.act()
      share2.act()
  
      share1.observe(
          Message({"text": "thread1-msg2", "episode_done": False})
      )
      share2.observe(
          Message({"text": "thread2-msg2", "episode_done": False})
      )
      share2.act()
      share1.act()
  
      share2.observe(
          Message({"text": "thread2-msg3", "episode_done": False})
      )
      share1.observe(
          Message({"text": "thread1-msg3", "episode_done": False})
      )
  
      self.assertNotIn("thread1-msg1", share2.history.get_history_str())
      self.assertNotIn("thread2-msg1", share1.history.get_history_str())
      self.assertNotIn("thread1-msg2", share2.history.get_history_str())
      self.assertNotIn("thread2-msg2", share1.history.get_history_str())
  
imports: import os
  import unittest
  from parlai.core.agents import create_agent_from_shared
  from parlai.utils.testing import tempdir
  from parlai.utils.misc import Message
label_desc: Use image node_id 18 for calling the TestTorchAgent obj's underlying member method code with example usage: obj.test_mturk_racehistory() without return types