docstr: asking for ar.data flushes outputs
docstr_tok: ["asking","for","ar.data","flushes","outputs"]
code: def test_await_data(self):
      """asking for ar.data flushes outputs"""
      self.minimum_engines(1)
  
      v = self.client[-1]
      ar = v.execute(
          "\n".join(
              [
                  "import time",
                  "from ipyparallel.datapub import publish_data",
                  "for i in range(5):",
                  "    publish_data(dict(i=i))",
                  "    time.sleep(0.1)",
              ]
          ),
          block=False,
      )
      found = set()
      tic = time.time()
      # timeout after 10s
      while time.time() <= tic + 10:
          if ar.data:
              i = ar.data["i"]
              found.add(i)
              if i == 4:
                  break
          time.sleep(0.05)
  
      ar.get(5)
      assert 4 in found
      assert len(found) > 1, (
          "should have seen data multiple times, but got: %s" % found
      )
  
imports: import os
  import time
  from datetime import datetime
  import pytest
  from IPython.utils.io import capture_output
  import ipyparallel
  from ipyparallel import error
  from .clienttest import ClusterTestCase, raises_remote
label_desc: Use image node_id 27 for calling the TestAsyncResult obj's underlying member method code with example usage: obj.test_await_data() without return types