aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorMiodec <[email protected]>2024-12-22 12:00:34 +0100
committerMiodec <[email protected]>2024-12-23 16:13:58 +0100
commitb52bb010b7e71c116715f2f623b6865d1c96a6d2 (patch)
treedc7e43a81c3cc3d8e8b1199cd6c3a92478aac535
parent9992d793a7f43640e4f30ce02435480e84320d14 (diff)
downloadmonkeytype-b52bb010b7e71c116715f2f623b6865d1c96a6d2.tar.gz
monkeytype-b52bb010b7e71c116715f2f623b6865d1c96a6d2.zip
chore: only check for inconsistent test duration in timed tests, shorter than 120s
closes #5401
-rw-r--r--frontend/src/ts/test/test-logic.ts8
1 files changed, 3 insertions, 5 deletions
diff --git a/frontend/src/ts/test/test-logic.ts b/frontend/src/ts/test/test-logic.ts
index 3874fba2a..ea494f2ba 100644
--- a/frontend/src/ts/test/test-logic.ts
+++ b/frontend/src/ts/test/test-logic.ts
@@ -919,13 +919,11 @@ export async function finish(difficultyFailed = false): Promise<void> {
//fail checks
const dateDur = (TestStats.end3 - TestStats.start3) / 1000;
if (
- Config.mode !== "zen" &&
+ Config.mode === "time" &&
!TestState.bailedOut &&
- (ce.testDuration < dateDur - 0.25 || ce.testDuration > dateDur + 0.25)
+ (ce.testDuration < dateDur - 0.1 || ce.testDuration > dateDur + 0.1) &&
+ ce.testDuration <= 120
) {
- //dont bother checking this for zen mode or bailed out tests because
- //the duration might be modified to remove trailing afk time
- //its also not a big deal if the duration is off in those tests
Notifications.add("Test invalid - inconsistent test duration", 0);
console.error("Test duration inconsistent", ce.testDuration, dateDur);
TestStats.setInvalid();