test timeout fixes
This commit is contained in:
parent
43ef9c9430
commit
be98fc6cf8
5 changed files with 8 additions and 7 deletions
2
.github/workflows/ci.yml
vendored
2
.github/workflows/ci.yml
vendored
|
|
@ -8,8 +8,8 @@ on:
|
|||
|
||||
jobs:
|
||||
build:
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 10
|
||||
|
||||
strategy:
|
||||
matrix:
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ const { Versions } = require('../src/options')
|
|||
const { getFiles } = require('../src/datatypes/util')
|
||||
const { join } = require('path')
|
||||
|
||||
const fileMap = {}
|
||||
let fileMap = {}
|
||||
|
||||
// Walks all the directories for each of the supported versions in options.js
|
||||
// then builds a file map for each version
|
||||
|
|
@ -23,6 +23,8 @@ function loadVersions () {
|
|||
}
|
||||
|
||||
module.exports = (protocolVersion) => {
|
||||
fileMap = {}
|
||||
loadVersions()
|
||||
return {
|
||||
// Returns the most recent file based on the specified protocolVersion
|
||||
// e.g. if `version` is 1.16 and a file for 1.16 doesn't exist, load from 1.15 file
|
||||
|
|
@ -40,5 +42,3 @@ module.exports = (protocolVersion) => {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
loadVersions()
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
"scripts": {
|
||||
"build": "cd tools && node compileProtocol.js",
|
||||
"prepare": "npm run build",
|
||||
"test": "mocha",
|
||||
"test": "mocha --bail",
|
||||
"pretest": "npm run lint",
|
||||
"lint": "standard",
|
||||
"vanillaServer": "node tools/startVanillaServer.js",
|
||||
|
|
|
|||
|
|
@ -191,10 +191,10 @@ async function requestChunks (x, z, radius) {
|
|||
return chunks
|
||||
}
|
||||
|
||||
async function timedTest (version) {
|
||||
async function timedTest (version, timeout = 1000 * 120) {
|
||||
await waitFor((res) => {
|
||||
startTest(version, res)
|
||||
}, 1000 * 60, () => {
|
||||
}, timeout, () => {
|
||||
throw Error('timed out')
|
||||
})
|
||||
console.info('✔ ok')
|
||||
|
|
|
|||
|
|
@ -87,6 +87,7 @@ async function dump (version, force) {
|
|||
})
|
||||
}, 1000 * 60, () => {
|
||||
clearInterval(loop)
|
||||
handle.kill()
|
||||
throw Error('timed out')
|
||||
})
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue