ci(core): Reduce memory usage in tests (part-1) (no-changelog) (#7654)

This commit is contained in:
कारतोफ्फेलस्क्रिप्ट™
2023-11-08 16:29:39 +01:00
committed by GitHub
parent 6a53c2a375
commit 0346b211a7
58 changed files with 1223 additions and 1189 deletions

View File

@@ -9,6 +9,8 @@ import { WorkflowHistoryManager } from '@/workflows/workflowHistory/workflowHist
import * as testDb from './shared/testDb';
import { mockInstance } from './shared/utils';
import { createWorkflow } from './shared/db/workflows';
import { createManyWorkflowHistoryItems } from './shared/db/workflowHistory';
describe('Workflow History Manager', () => {
const license = mockInstance(License);
@@ -98,9 +100,9 @@ describe('Workflow History Manager', () => {
});
const createWorkflowHistory = async (ageInDays = 2) => {
const workflow = await testDb.createWorkflow();
const workflow = await createWorkflow();
const time = DateTime.now().minus({ days: ageInDays }).toJSDate();
return testDb.createManyWorkflowHistoryItems(workflow.id, 10, time);
return createManyWorkflowHistoryItems(workflow.id, 10, time);
};
const pruneAndAssertCount = async (finalCount = 10, initialCount = 10) => {