js-waku/packages/reliability-tests/tests/throughput-sizes.spec.ts
fbarbu15 c1f9471cd7
chore: extra reliability tests 2 (#2450)
* chore: add throughput reliability tests

* chore: add capability to run all

* chore: add network-latency reliability tests

* chore: add network-latency reliability tests

* chore: add other network reliability tests

* chore: add other network reliability tests

* chore: fix tc cleanup

* chore: refactor common code

* chore: refactor common code

* chore: refactor common code

* chore: refactor common code

* chore: refactor common code

* chore: refactor common code

* chore: refactor common code

* chore: fix

* chore: fix tests

* chore: fix tests
2025-07-29 10:17:43 +03:00

33 lines
862 B
TypeScript

import {
generateRandomString,
printSizeDistributionReport,
runTest,
setupTest
} from "./sharedTestUtils.js";
const sizes = [10, 100, 1000, 10_000, 100_000]; // bytes
describe("Throughput Sanity Checks - Different Message Sizes", function () {
const testDurationMs = 20 * 60 * 1000; // 20 minute
const testContext: { report?: any } = {};
setupTest(this, testContext);
afterEach(async () => {
if (testContext.report) {
printSizeDistributionReport(testContext.report);
}
});
runTest({
testContext: testContext,
testDurationMs: testDurationMs,
testName: "Throughput Sanity Checks - Different Message Sizes",
messageGenerator: (_messageId: number) => {
const size = sizes[Math.floor(Math.random() * sizes.length)];
return generateRandomString(size);
},
delayBetweenMessagesMs: 400
});
});