Skip to content

Commit

Permalink
dont fail because of avg round trip times
Browse files Browse the repository at this point in the history
  • Loading branch information
jakobgetz committed Feb 6, 2024
1 parent 27991d6 commit c9a944e
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions tests/run-tests.cts
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,10 @@ async function runNodeTest(name: string, options): Promise<TestReport> {

function writeSummary(type: string, testCount: number, successfull: number, roundTripTimes: DOMHighResTimeStamp[]) {
const fail = testCount - successfull
const avgRoundTripTime = roundTripTimes.reduce((p, c) => p + c) / roundTripTimes.length
let avgRoundTripTime = undefined
if (roundTripTimes.length > 0) {
avgRoundTripTime = roundTripTimes.reduce((p, c) => p + c) / roundTripTimes.length
}
console.log(`finished running ${testCount} ${type} testcases. Pass: ${successfull}, Fail: ${fail}, FailRate: ${fail / testCount * 100}%, Avg time: ${avgRoundTripTime}`);
}

Expand Down Expand Up @@ -231,7 +234,7 @@ async function runOnlineTests(names: string[], options) {
cleanUpPerformance()
await writeReport(name, report)
if (report.success === true) {
successfull++
successfull++
}
if (report.roundTripTime !== undefined) {
roundTripTimes.push(report.roundTripTime)
Expand Down

0 comments on commit c9a944e

Please sign in to comment.