mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 01:56:46 +00:00
test: Add baseline memory test (#19102)
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
import { test, expect } from '../../fixtures/cloud';
|
||||
import { attachMetric, pollMemoryMetric } from '../../utils/performance-helper';
|
||||
|
||||
test.describe('Memory Consumption', () => {
|
||||
const CONTAINER_STABILIZATION_TIME = 20000;
|
||||
const POLL_MEMORY_DURATION = 30000;
|
||||
const STARTER_PLAN_MEMORY_LIMIT = 768;
|
||||
|
||||
test('Memory consumption baseline with starter plan resources @cloud:starter', async ({
|
||||
cloudContainer,
|
||||
}, testInfo) => {
|
||||
// Wait for container to stabilize
|
||||
await new Promise((resolve) => setTimeout(resolve, CONTAINER_STABILIZATION_TIME));
|
||||
|
||||
// Poll memory metric for 30 seconds to get baseline
|
||||
const averageMemoryBytes = await pollMemoryMetric(
|
||||
cloudContainer.baseUrl,
|
||||
POLL_MEMORY_DURATION,
|
||||
1000,
|
||||
);
|
||||
const averageMemoryMB = averageMemoryBytes / 1024 / 1024;
|
||||
|
||||
await attachMetric(testInfo, 'memory-consumption-baseline', averageMemoryMB, 'MB');
|
||||
|
||||
// Verify memory is within starter plan limits (768MB)
|
||||
expect(averageMemoryMB).toBeLessThan(STARTER_PLAN_MEMORY_LIMIT);
|
||||
expect(averageMemoryMB).toBeGreaterThan(100);
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user