| @@ -518,8 +518,6 @@ class TestMain(unittest.TestCase): | |||||
| badclientkeypath = os.path.join(self.tempdir, 'badclient_key') | badclientkeypath = os.path.join(self.tempdir, 'badclient_key') | ||||
| await self.genkey(badclientkeypath) | await self.genkey(badclientkeypath) | ||||
| await asyncio.sleep(.1) | |||||
| # forwards connectsion to this socket (created by client) | # forwards connectsion to this socket (created by client) | ||||
| ptclientpath = os.path.join(self.tempdir, 'incclient.sock') | ptclientpath = os.path.join(self.tempdir, 'incclient.sock') | ||||
| ptclientstr = _makeunix(ptclientpath) | ptclientstr = _makeunix(ptclientpath) | ||||
| @@ -560,8 +558,6 @@ class TestMain(unittest.TestCase): | |||||
| # wait for client to start | # wait for client to start | ||||
| await _awaitfile(ptclientpath) | await _awaitfile(ptclientpath) | ||||
| await asyncio.sleep(.1) | |||||
| # Connect to the client | # Connect to the client | ||||
| reader, writer = await connectsockstr(ptclientstr) | reader, writer = await connectsockstr(ptclientstr) | ||||
| @@ -588,9 +584,6 @@ class TestMain(unittest.TestCase): | |||||
| clientkeypath = os.path.join(self.tempdir, 'client_key') | clientkeypath = os.path.join(self.tempdir, 'client_key') | ||||
| await self.genkey(clientkeypath) | await self.genkey(clientkeypath) | ||||
| await asyncio.sleep(.1) | |||||
| #import pdb; pdb.set_trace() | |||||
| # forwards connectsion to this socket (created by client) | # forwards connectsion to this socket (created by client) | ||||
| ptclientpath = os.path.join(self.tempdir, 'incclient.sock') | ptclientpath = os.path.join(self.tempdir, 'incclient.sock') | ||||
| ptclientstr = _makeunix(ptclientpath) | ptclientstr = _makeunix(ptclientpath) | ||||
| @@ -633,8 +626,6 @@ class TestMain(unittest.TestCase): | |||||
| # wait for client to start | # wait for client to start | ||||
| await _awaitfile(ptclientpath) | await _awaitfile(ptclientpath) | ||||
| await asyncio.sleep(.1) | |||||
| # Connect to the client | # Connect to the client | ||||
| reader, writer = await connectsockstr(ptclientstr) | reader, writer = await connectsockstr(ptclientstr) | ||||
| @@ -781,8 +772,10 @@ class TestNoiseFowarder(unittest.TestCase): | |||||
| # Setup pt target listener | # Setup pt target listener | ||||
| pttarg = _makeunix(servptpath) | pttarg = _makeunix(servptpath) | ||||
| ptsock = [] | ptsock = [] | ||||
| ptsockevent = asyncio.Event() | |||||
| def ptsockaccept(reader, writer, ptsock=ptsock): | def ptsockaccept(reader, writer, ptsock=ptsock): | ||||
| ptsock.append((reader, writer)) | ptsock.append((reader, writer)) | ||||
| ptsockevent.set() | |||||
| # Bind to pt listener | # Bind to pt listener | ||||
| lsock = await listensockstr(pttarg, ptsockaccept) | lsock = await listensockstr(pttarg, ptsockaccept) | ||||
| @@ -846,8 +839,8 @@ class TestNoiseFowarder(unittest.TestCase): | |||||
| writer.write(enclenfun(encmsg)) | writer.write(enclenfun(encmsg)) | ||||
| writer.write(encmsg) | writer.write(encmsg) | ||||
| # XXX - how to sync? | |||||
| await asyncio.sleep(.1) | |||||
| # wait for the connection to arrive | |||||
| await ptsockevent.wait() | |||||
| ptreader, ptwriter = ptsock[0] | ptreader, ptwriter = ptsock[0] | ||||
| # read the test message | # read the test message | ||||
| @@ -861,9 +854,6 @@ class TestNoiseFowarder(unittest.TestCase): | |||||
| writer.write(enclenfun(encmsg)) | writer.write(enclenfun(encmsg)) | ||||
| writer.write(encmsg) | writer.write(encmsg) | ||||
| # XXX - how to sync? | |||||
| await asyncio.sleep(.1) | |||||
| # read the test message | # read the test message | ||||
| rptmsg = await ptreader.readexactly(len(ptmsg)) | rptmsg = await ptreader.readexactly(len(ptmsg)) | ||||