aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorMatt Godbolt <matt@godbolt.org>2023-08-07 22:17:12 -0500
committerGitHub <noreply@github.com>2023-08-07 22:17:12 -0500
commit6c476bbccc58c4eb01bcf08838a093dcadbf2a87 (patch)
treef19bb949c7cd02b2d595e5b2f4b2ea6f243d63ed /test
parentc5300fad6386bcfdc94e0ed4b2d862ce21439737 (diff)
downloadcompiler-explorer-6c476bbccc58c4eb01bcf08838a093dcadbf2a87.tar.gz
compiler-explorer-6c476bbccc58c4eb01bcf08838a093dcadbf2a87.zip
Support abandoned queued compilations (#5278)gh-8398
After some time we know either the client or CloudFront will give up on pending compilations. As such, if we continue to process compilations after the client's timed out we're just clogging up the compilation queue with pointless work. As such, this change now supports the notion of "stale" work which will be abandoned once it's made it to the front of the queue. Only compiles coming from the user will be abandoned, so discovery and health checks are unaffected. Hopefully this will mitigate the number of nodes marked unhealthy due to being overloaded: work they were doing was "pointless" anyway, and them being killed by going unhealthy is equivalent to abandoning all the work in flight anyway, but this means there's a fighting chance the node will recover quickly enough to return a "healthy" status.
Diffstat (limited to 'test')
-rw-r--r--test/utils.ts4
1 files changed, 2 insertions, 2 deletions
diff --git a/test/utils.ts b/test/utils.ts
index ed613ac9a..fd242cd0b 100644
--- a/test/utils.ts
+++ b/test/utils.ts
@@ -37,7 +37,7 @@ import {ParseFiltersAndOutputOptions} from '../types/features/filters.interfaces
// TODO: Find proper type for options
export function makeCompilationEnvironment(options: Record<string, any>): CompilationEnvironment {
const compilerProps = new CompilerProps(options.languages, fakeProps(options.props || {}));
- const compilationQueue = options.queue || new CompilationQueue(options.concurrency || 1, options.timeout);
+ const compilationQueue = options.queue || new CompilationQueue(options.concurrency || 1, options.timeout, 100_000);
return new CompilationEnvironment(compilerProps, compilationQueue, options.doCache);
}
@@ -53,7 +53,7 @@ export function makeFakeParseFiltersAndOutputOptions(
export const should = chai.should();
-// This compbines a shoudl assert and a type guard
+// This combines a should assert and a type guard
// Example:
//
// let a: null|number = 1;