code: def test_tcp_async():
      port = 9876
      s = Source.from_tcp(port)
      out = s.sink_to_list()
      s.start()
      yield await_for(lambda: s.server is not None, 2, period=0.02)
  
      try:
          sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
          sock.connect(("localhost", port))
          sock.send(b"data\n")
          sock.close()
  
          sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
          sock.connect(("localhost", port))
          sock.send(b"data\n")
  
          sock2 = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
          sock2.connect(("localhost", port))
          sock2.send(b"data2\n")
          yield await_for(
              lambda: out == [b"data\n", b"data\n", b"data2\n"],
              2,
              period=0.01,
          )
      finally:
          s.stop()
          sock.close()
          sock2.close()
  
file_path: streamz/streamz/tests/test_sources.py
imports: import asyncio
  import sys
  from flaky import flaky
  import pytest
  from streamz import Source
  from streamz.utils_test import wait_for, await_for, gen_test
  import socket
label_desc: Use image node_id 3 for calling a global function with example usage: test_tcp_async() without return types