fix(benchmark): Fix some multi-main benchmarks failing randomly (#11317)

This commit is contained in:
Tomi Turtiainen 2024-10-21 11:58:47 +03:00 committed by GitHub
parent 76724c3be6
commit fcf8629c6e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1,3 +1,5 @@
import { sleep } from 'zx';
import { AuthenticatedN8nApiClient } from '@/n8n-api-client/authenticated-n8n-api-client';
import type { N8nApiClient } from '@/n8n-api-client/n8n-api-client';
import type { ScenarioDataFileLoader } from '@/scenario/scenario-data-loader';
@ -47,6 +49,10 @@ export class ScenarioRunner {
const testData = await this.dataLoader.loadDataForScenario(scenario);
await testDataImporter.importTestScenarioData(testData.workflows);
// Wait for 1s before executing the scenario to ensure that the workflows are activated.
// In multi-main mode it can take some time before the workflow becomes active.
await sleep(1000);
console.log('Executing scenario script');
await this.k6Executor.executeTestScenario(scenario, {
scenarioRunName,