Skip to content

Commit 9ea9902

Browse files
committed
for travis
1 parent 7d7cea5 commit 9ea9902

File tree

2 files changed

+13
-5
lines changed

2 files changed

+13
-5
lines changed

spec/client_ev_spec.lua

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -154,12 +154,17 @@ describe(
154154
end)
155155

156156
it(
157-
'socket err gets forwarded to on_error'..req_ws,
157+
'socket err gets forwarded to on_error',
158158
function(done)
159+
settimeout(3.0)
159160
wsc:on_error(async(function(ws,err)
160161
assert.is_same(ws,wsc)
161162
if socket.tcp6 then
162-
assert.is_equal(err,'host or service not provided, or not known')
163+
local expected = {
164+
['host or service not provided, or not known'] = true,
165+
['accept failed'] = true
166+
}
167+
assert.is_true(expected[err])
163168
else
164169
assert.is_equal(err,'host not found')
165170
end
@@ -176,6 +181,7 @@ describe(
176181
it(
177182
'can send and receive data'..req_ws,
178183
function(done)
184+
settimeout(3.0)
179185
assert.is_function(wsc.send)
180186
wsc:on_message(
181187
async(
@@ -202,6 +208,7 @@ describe(
202208
it(
203209
'can send and receive data 127 byte messages'..req_ws,
204210
function(done)
211+
settimeout(3.0)
205212
local msg = random_text(127)
206213
wsc:on_message(
207214
async(
@@ -217,7 +224,7 @@ describe(
217224
it(
218225
'can send and receive data 0xffff-1 byte messages'..req_ws,
219226
function(done)
220-
settimeout(3.0)
227+
settimeout(10.0)
221228
local msg = random_text(0xffff-1)
222229
wsc:on_message(
223230
async(
@@ -233,7 +240,7 @@ describe(
233240
it(
234241
'can send and receive data 0xffff+1 byte messages'..req_ws,
235242
function(done)
236-
settimeout(3.0)
243+
settimeout(10.0)
237244
local msg = random_text(0xffff+1)
238245
wsc:on_message(
239246
async(
@@ -249,6 +256,7 @@ describe(
249256
it(
250257
'closes cleanly'..req_ws,
251258
function(done)
259+
settimeout(3.0)
252260
wsc:on_close(async(function(_,was_clean,code,reason)
253261
assert.is_true(was_clean)
254262
assert.is_true(code >= 1000)

spec/client_spec.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ describe(
6767
'forwards socket errors',
6868
function()
6969
local c = client.new()
70-
local ok,err = c:connect('ws://localhost:8189','echo-protocol')
70+
local ok,err = c:connect('ws://localhost:1','echo-protocol')
7171
assert.is_nil(ok)
7272
assert.is_equal(err,'connection refused')
7373

0 commit comments

Comments
 (0)