MCPcopy Create free account
hub / github.com/avoidwork/tenso / stressTests

Function stressTests

benchmarks/load-test.js:397–441  ·  view source on GitHub ↗

* Stress tests with very high load

(server)

Source from the content-addressed store, hash-verified

395 * Stress tests with very high load
396 */
397async function stressTests (server) {
398 const baseUrl = `http://localhost:${server.server.address().port}`;
399
400 console.log("\n🔥 Stress Tests");
401 console.log("=".repeat(50));
402
403 const tests = [
404 {
405 title: "Stress Test - High Connections",
406 url: `${baseUrl}/ping`,
407 connections: 200,
408 duration: 15
409 },
410 {
411 title: "Stress Test - Very High Connections",
412 url: `${baseUrl}/ping`,
413 connections: 500,
414 duration: 10
415 },
416 {
417 title: "Stress Test - JSON with High Load",
418 url: `${baseUrl}/users`,
419 connections: 100,
420 duration: 15
421 },
422 {
423 title: "Stress Test - Large Response High Load",
424 url: `${baseUrl}/large`,
425 connections: 50,
426 duration: 10
427 }
428 ];
429
430 const results = [];
431 for (const test of tests) {
432 console.log("\n⚠️ Warning: Running high-load stress test...");
433 const result = await runLoadTest(test);
434 results.push({ ...test, result });
435
436 // Longer pause between stress tests
437 await new Promise(resolve => setTimeout(resolve, 3000));
438 }
439
440 return results;
441}
442
443/**
444 * Parameterized endpoint tests

Callers 1

mainFunction · 0.85

Calls 2

runLoadTestFunction · 0.85
logMethod · 0.80

Tested by

no test coverage detected