Skip to content

Commit

Permalink
test, bugfix: some time-related test cases throw errors because of th…
Browse files Browse the repository at this point in the history
…e performance of the ci server.
  • Loading branch information
xicilion committed Sep 30, 2019
1 parent 5160498 commit a241e2f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions test/net_test.js
Expand Up @@ -40,7 +40,7 @@ var backend = {
"Darwin": "KQueue",
"FreeBSD": "KQueue",
"Linux": "EPoll"
}[os.type()];
} [os.type()];


function del(f) {
Expand Down Expand Up @@ -359,8 +359,10 @@ describe("net", () => {

var no = test_util.countObject('Timer');
c1.connect('127.0.0.1', 8085 + base_port);
for (var i = 0; i < 1000 && no !== test_util.countObject('Timer'); i++)
for (var i = 0; i < 1000 && no !== test_util.countObject('Timer'); i++) {
GC();
coroutine.sleep(50);
}
assert.equal(no, test_util.countObject('Timer'));

var t1 = new Date();
Expand Down
2 changes: 1 addition & 1 deletion test/timer_test.js
Expand Up @@ -464,7 +464,7 @@ describe("timer", () => {
});
var t2 = new Date();
assert.greaterThan(t2 - t1, 90);
assert.lessThan(t2 - t1, 150);
assert.lessThan(t2 - t1, 200);
});

it("util.format", () => {
Expand Down

0 comments on commit a241e2f

Please sign in to comment.