diff --git a/Dockerfile.prod b/Dockerfile.prod index 4e05025..d70e973 100644 --- a/Dockerfile.prod +++ b/Dockerfile.prod @@ -68,4 +68,4 @@ RUN sudo cp -a /tmp/riju/* /home/docker/src/ && rm -rf /tmp/riju WORKDIR /home/docker/src RUN sudo deluser docker sudo -RUN RIJU_PRIVILEGED=1 CONCURRENCY=1 TIMEOUT_SECS=30 yarn test +RUN RIJU_PRIVILEGED=1 CONCURRENCY=1 TIMEOUT_FACTOR=5 yarn test diff --git a/README.md b/README.md index ac6c4ad..5c437bf 100644 --- a/README.md +++ b/README.md @@ -63,7 +63,7 @@ additional layers. You can build it as follows: Lastly I should mention the tests. There are integration tests for every language, and they can be run as follows: - $ [CONCURRENCY=2] [TIMEOUT=5] yarn test [...] + $ [CONCURRENCY=2] [TIMEOUT_FACTOR=1] yarn test [...] Filters can be for language (`python`, `java`) or test type (`hello`, `lsp`). You can comma-delimit multiple filters to do a disjunction, diff --git a/backend/src/test-runner.ts b/backend/src/test-runner.ts index 0ab8b06..025667a 100644 --- a/backend/src/test-runner.ts +++ b/backend/src/test-runner.ts @@ -15,8 +15,9 @@ function parseIntOr(thing: any, def: number) { return Number.isNaN(num) ? def : num; } -const TIMEOUT_SECS = parseIntOr(process.env.TIMEOUT_SECS, 5); +const TIMEOUT_FACTOR = parseIntOr(process.env.TIMEOUT_FACTOR, 1); const CONCURRENCY = parseIntOr(process.env.CONCURRENCY, 2); +const BASE_TIMEOUT_SECS = 5; function findPosition(str: string, idx: number) { const lines = str.substring(0, idx).split("\n"); @@ -103,7 +104,7 @@ class Test { timeout = setTimeout(() => { this.timedOut = true; this.handleUpdate(); - }, (this.config.timeout || TIMEOUT_SECS) * 1000); + }, (this.config.timeout || BASE_TIMEOUT_SECS) * 1000 * TIMEOUT_FACTOR); await session.setup(); switch (this.type) { case "ensure":