fix(benchmark): Simplify binary data scenario setup and use larger binary file (#10879)

This commit is contained in:
Tomi Turtiainen 2024-09-19 16:21:55 +03:00 committed by GitHub
parent cee57b6504
commit 8fb31e8459
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 3 additions and 3 deletions

View file

@ -3,8 +3,9 @@ import { check } from 'k6';
const apiBaseUrl = __ENV.API_BASE_URL; const apiBaseUrl = __ENV.API_BASE_URL;
const file = open(__ENV.SCRIPT_FILE_PATH, 'b'); // This creates a 2MB file (16 * 128 * 1024 = 2 * 1024 * 1024 = 2MB)
const filename = String(__ENV.SCRIPT_FILE_PATH).split('/').pop(); const file = Array.from({ length: 128 * 1024 }, () => Math.random().toString().slice(2)).join('');
const filename = 'test.bin';
export default function () { export default function () {
const data = { const data = {

View file

@ -77,7 +77,6 @@ export function handleSummary(data) {
env: { env: {
API_BASE_URL: this.opts.n8nApiBaseUrl, API_BASE_URL: this.opts.n8nApiBaseUrl,
K6_CLOUD_TOKEN: this.opts.k6ApiToken, K6_CLOUD_TOKEN: this.opts.k6ApiToken,
SCRIPT_FILE_PATH: augmentedTestScriptPath,
}, },
stdio: 'inherit', stdio: 'inherit',
})`${k6ExecutablePath} run ${flattedFlags} ${augmentedTestScriptPath}`; })`${k6ExecutablePath} run ${flattedFlags} ${augmentedTestScriptPath}`;