Skip to content

Commit

Permalink
Merge pull request #36 from moteus/master
Browse files Browse the repository at this point in the history
Add timeout to start thread in proxy text.
  • Loading branch information
moteus committed Apr 3, 2015
2 parents 23f6cb3 + 474c818 commit 1604c44
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions test/test_proxy.lua
Expand Up @@ -113,6 +113,8 @@ function test_capture()

assert_equal(thread, thread:start())

ztimer.sleep(1000)

assert(cli:send("hello"))

local msg = assert_table(pipe:recv_all())
Expand Down Expand Up @@ -149,7 +151,9 @@ function test_basic()
local cli = assert(ctx:socket{zmq.REQ, bind = cli_endpoint, rcvtimeo=1000})
local srv = assert(ctx:socket{zmq.REP, bind = srv_endpoint, rcvtimeo=1000})

thread:start()
assert_equal(thread, thread:start())

ztimer.sleep(1000)

assert(cli:send("hello"))
assert_equal('hello', srv:recv())
Expand Down Expand Up @@ -199,7 +203,9 @@ function test_control()
local srv = assert(ctx:socket{zmq.REP, bind = srv_endpoint, rcvtimeo=1000})
pipe:set_rcvtimeo(1000)

thread:start()
assert_equal(thread, thread:start())

ztimer.sleep(1000)

pipe:send("PAUSE")
assert(cli:send("hello"))
Expand Down Expand Up @@ -231,7 +237,9 @@ function test_basic()
local cli = assert(ctx:socket{zmq.REQ, bind = cli_endpoint, rcvtimeo=1000})
local srv = assert(ctx:socket{zmq.REP, bind = srv_endpoint, rcvtimeo=1000})

thread:start()
assert_equal(thread, thread:start())

ztimer.sleep(1000)

assert(cli:send("hello"))
assert_equal('hello', srv:recv())
Expand Down

0 comments on commit 1604c44

Please sign in to comment.