Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit a3c21d5

Browse filesBrowse files
committed
test images in batches:
- by calling testMock inside setTimeout
1 parent 1bad588 commit a3c21d5
Copy full SHA for a3c21d5

File tree

1 file changed

+10
-4
lines changed
Filter options

1 file changed

+10
-4
lines changed

‎test/image/compare_pixels_test.js

Copy file name to clipboardExpand all lines: test/image/compare_pixels_test.js
+10-4Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ else runSingle(userFileName);
3131
function runAll () {
3232
test('testing mocks', function (t) {
3333

34-
var files = fs.readdirSync(constants.pathToTestImageMocks);
34+
var allMocks = fs.readdirSync(constants.pathToTestImageMocks);
3535

3636
/*
3737
* Some test cases exhibit run-to-run randomness;
@@ -45,10 +45,16 @@ function runAll () {
4545
* - all gl2d (38)
4646
* - gl2d_bunny-hull (1)
4747
*/
48-
t.plan(files.length - 40);
48+
t.plan(allMocks.length - 40);
4949

50-
for (var i = 0; i < 20; i ++) {
51-
testMock(files[i], t);
50+
var BASE_TIMEOUT = 500,
51+
BATCH_SIZE = 5,
52+
cnt = 0;
53+
54+
for(var i = 0; i < allMocks.length; i++) {
55+
setTimeout(function() {
56+
testMock(allMocks[cnt++], t);
57+
}, BASE_TIMEOUT * Math.floor(i / BATCH_SIZE) * BATCH_SIZE);
5258
}
5359

5460
});

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.