Skip to content

Commit

Permalink
chore: only check for inconsistent test duration in timed tests, shor…
Browse files Browse the repository at this point in the history
…ter than 120s

closes monkeytypegame#5401
  • Loading branch information
Miodec committed Dec 23, 2024
1 parent 9992d79 commit b52bb01
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions frontend/src/ts/test/test-logic.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit b52bb01

Please sign in to comment.