1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

time: time.wait() => time.sleep()

This commit is contained in:
Alexander Medvednikov
2021-02-27 20:41:06 +03:00
parent be4a2e17d3
commit 3a2d696fac
42 changed files with 76 additions and 67 deletions

View File

@ -20,7 +20,7 @@ fn test_ws() {
}
port := 30000 + rand.intn(1024)
go start_server(port)
time.wait(500 * time.millisecond)
time.sleep(500 * time.millisecond)
ws_test('ws://localhost:$port') or { assert false }
}
@ -92,10 +92,10 @@ fn ws_test(uri string) ? {
for msg in text {
ws.write(msg.bytes(), .text_frame) or { panic('fail to write to websocket') }
// sleep to give time to recieve response before send a new one
time.wait(100 * time.millisecond)
time.sleep(100 * time.millisecond)
}
// sleep to give time to recieve response before asserts
time.wait(1500 * time.millisecond)
time.sleep(1500 * time.millisecond)
// We expect at least 2 pongs, one sent directly and one indirectly
assert test_results.nr_pong_received >= 2
assert test_results.nr_messages == 2