Beispiel #1
0
def test_remote_not_allowed():
    f_args = set_gateway_parser().parse_args([])
    p_args = set_pea_parser().parse_args(
        ['--host', 'localhost', '--port-expose',
         str(f_args.port_expose)])
    with GatewayPod(f_args):
        PeaSpawnHelper(p_args).start()
Beispiel #2
0
 def start_client(d):
     print('im running %d' % d)
     p_args = set_pea_parser().parse_args([
         '--host', 'localhost', '--name',
         'testpea%d' % d, '--port-expose',
         str(f_args.port_expose)
     ])
     PeaSpawnHelper(p_args).start()
Beispiel #3
0
    def test_remote_pea(self):
        f_args = set_gateway_parser().parse_args(['--allow-spawn'])

        p_args = set_pea_parser().parse_args(['--host', 'localhost', '--port-grpc', str(f_args.port_grpc)])

        def start_gateway():
            with GatewayPod(f_args):
                time.sleep(5)

        t = Process(target=start_gateway)
        t.daemon = True
        t.start()

        time.sleep(1)
        PeaSpawnHelper(p_args).start()
        t.join()