diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c565b62..7803afb 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -8,8 +8,8 @@ on: jobs: build: - runs-on: ubuntu-latest + timeout-minutes: 10 strategy: matrix: diff --git a/data/provider.js b/data/provider.js index 3f51f02..6ad1af7 100644 --- a/data/provider.js +++ b/data/provider.js @@ -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() diff --git a/package.json b/package.json index 9bb997d..9be65ba 100644 --- a/package.json +++ b/package.json @@ -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", diff --git a/test/internal.js b/test/internal.js index 6e04641..f87d258 100644 --- a/test/internal.js +++ b/test/internal.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') diff --git a/tools/genPacketDumps.js b/tools/genPacketDumps.js index 3b3de74..33530d8 100644 --- a/tools/genPacketDumps.js +++ b/tools/genPacketDumps.js @@ -87,6 +87,7 @@ async function dump (version, force) { }) }, 1000 * 60, () => { clearInterval(loop) + handle.kill() throw Error('timed out') }) }