def test_client_timeout(): """ Tests what happens when the client does not finish a full request """ client_deployer = runtime.get_deployer("AdditionClient") start_client = lambda: client_deployer.start("client1", configs={"args": "localhost 8000".split() + LARGE_SAMPLE, "sync": True}) timeout_client = lambda: _client_timeout(client_deployer, "client1") testutilities.start_threads_and_join([start_client, timeout_client])
def test_race_condition(): """ Tests what happens when two clients send requests to the same server """ # obtain the deployer for AdditionClients client_deployer = runtime.get_deployer("AdditionClient") start_client1 = lambda: client_deployer.start("client1", configs={"args": "localhost 8000".split() + SMALL_SAMPLE, "sync": True}) start_client2 = lambda: client_deployer.start("client2", configs={"args": "localhost 8000".split() + SMALL_SAMPLE, "sync": True}) testutilities.start_threads_and_join([start_client1, start_client2])
def test_client_timeout(): """ Tests what happens when the client does not finish a full request """ client_deployer = runtime.get_deployer("AdditionClient") start_client = lambda: client_deployer.start( "client1", configs={ "args": "localhost 8000".split() + LARGE_SAMPLE, "sync": True }) timeout_client = lambda: _client_timeout(client_deployer, "client1") testutilities.start_threads_and_join([start_client, timeout_client])