mirror of
https://github.com/n8n-io/n8n.git
synced 2026-06-04 18:49:20 +02:00
test: Fix binary data benchmarks (#31198)
This commit is contained in:
parent
95e4ee7ee2
commit
d7b759dfb4
|
|
@ -29,7 +29,7 @@
|
|||
{
|
||||
"parameters": {
|
||||
"operation": "write",
|
||||
"fileName": "=file-{{ Date.now() }}-{{ Math.random() }}.js",
|
||||
"fileName": "={{ $('Webhook').item.json.body.filePath }}/file-{{ Date.now() }}-{{ Math.random() }}.bin",
|
||||
"dataPropertyName": "file",
|
||||
"options": {}
|
||||
},
|
||||
|
|
@ -40,7 +40,10 @@
|
|||
"name": "Write File to Disk"
|
||||
},
|
||||
{
|
||||
"parameters": { "fileSelector": "={{ $json.fileName }}", "options": {} },
|
||||
"parameters": {
|
||||
"fileSelector": "={{ $json.fileName }}",
|
||||
"options": {}
|
||||
},
|
||||
"type": "n8n-nodes-base.readWriteFile",
|
||||
"typeVersion": 1,
|
||||
"position": [500, 0],
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ import http from 'k6/http';
|
|||
import { check } from 'k6';
|
||||
|
||||
const apiBaseUrl = __ENV.API_BASE_URL;
|
||||
const n8nDataDirPath = __ENV.N8N_DATA_DIR_PATH || '/n8n';
|
||||
|
||||
// This creates a 2MB file (16 * 128 * 1024 = 2 * 1024 * 1024 = 2MB)
|
||||
const file = Array.from({ length: 128 * 1024 }, () => Math.random().toString().slice(2)).join('');
|
||||
|
|
@ -10,7 +11,8 @@ const filename = 'test.bin';
|
|||
export default function () {
|
||||
const data = {
|
||||
filename,
|
||||
file: http.file(file, filename, 'application/javascript'),
|
||||
file: http.file(file, filename, 'application/octet-stream'),
|
||||
filePath: n8nDataDirPath,
|
||||
};
|
||||
|
||||
const res = http.post(`${apiBaseUrl}/webhook/binary-files-benchmark`, data);
|
||||
|
|
@ -24,6 +26,6 @@ export default function () {
|
|||
check(res, {
|
||||
'is status 200': (r) => r.status === 200,
|
||||
'has correct content type': (r) =>
|
||||
r.headers['Content-Type'] === 'application/javascript; charset=utf-8',
|
||||
r.headers['Content-Type'] === 'application/octet-stream; charset=utf-8',
|
||||
});
|
||||
}
|
||||
|
|
|
|||
|
|
@ -32,6 +32,9 @@ services:
|
|||
- DB_TYPE=postgresdb
|
||||
- DB_POSTGRESDB_HOST=postgres
|
||||
- DB_POSTGRESDB_PASSWORD=password
|
||||
# For binary data test to work
|
||||
- N8N_RESTRICT_FILE_ACCESS_TO=''
|
||||
- N8N_BLOCK_FILE_ACCESS_TO_N8N_FILES=false
|
||||
# Task Runner config
|
||||
- N8N_RUNNERS_MODE=external
|
||||
- N8N_RUNNERS_BROKER_LISTEN_ADDRESS=0.0.0.0
|
||||
|
|
|
|||
|
|
@ -41,6 +41,9 @@ services:
|
|||
- N8N_LICENSE_CERT=${N8N_LICENSE_CERT}
|
||||
- N8N_LICENSE_ACTIVATION_KEY=${N8N_LICENSE_ACTIVATION_KEY}
|
||||
- N8N_LICENSE_TENANT_ID=${N8N_LICENSE_TENANT_ID}
|
||||
# For binary data test to work
|
||||
- N8N_RESTRICT_FILE_ACCESS_TO=''
|
||||
- N8N_BLOCK_FILE_ACCESS_TO_N8N_FILES=false
|
||||
# Scaling mode config
|
||||
- EXECUTIONS_MODE=queue
|
||||
- QUEUE_BULL_REDIS_HOST=redis
|
||||
|
|
@ -87,6 +90,9 @@ services:
|
|||
- N8N_LICENSE_CERT=${N8N_LICENSE_CERT}
|
||||
- N8N_LICENSE_ACTIVATION_KEY=${N8N_LICENSE_ACTIVATION_KEY}
|
||||
- N8N_LICENSE_TENANT_ID=${N8N_LICENSE_TENANT_ID}
|
||||
# For binary data test to work
|
||||
- N8N_RESTRICT_FILE_ACCESS_TO=''
|
||||
- N8N_BLOCK_FILE_ACCESS_TO_N8N_FILES=false
|
||||
# Scaling mode config
|
||||
- EXECUTIONS_MODE=queue
|
||||
- QUEUE_BULL_REDIS_HOST=redis
|
||||
|
|
|
|||
|
|
@ -39,6 +39,9 @@ services:
|
|||
- N8N_DIAGNOSTICS_ENABLED=false
|
||||
- N8N_USER_FOLDER=/n8n/worker1
|
||||
- N8N_ENCRYPTION_KEY=${N8N_ENCRYPTION_KEY}
|
||||
# For binary data test to work
|
||||
- N8N_RESTRICT_FILE_ACCESS_TO=''
|
||||
- N8N_BLOCK_FILE_ACCESS_TO_N8N_FILES=false
|
||||
# Queue mode config
|
||||
- EXECUTIONS_MODE=queue
|
||||
- QUEUE_BULL_REDIS_HOST=redis
|
||||
|
|
@ -83,6 +86,9 @@ services:
|
|||
- N8N_DIAGNOSTICS_ENABLED=false
|
||||
- N8N_USER_FOLDER=/n8n/worker2
|
||||
- N8N_ENCRYPTION_KEY=${N8N_ENCRYPTION_KEY}
|
||||
# For binary data test to work
|
||||
- N8N_RESTRICT_FILE_ACCESS_TO=''
|
||||
- N8N_BLOCK_FILE_ACCESS_TO_N8N_FILES=false
|
||||
# Queue mode config
|
||||
- EXECUTIONS_MODE=queue
|
||||
- QUEUE_BULL_REDIS_HOST=redis
|
||||
|
|
|
|||
|
|
@ -13,6 +13,9 @@ services:
|
|||
- N8N_DIAGNOSTICS_ENABLED=false
|
||||
- N8N_USER_FOLDER=/n8n
|
||||
- DB_SQLITE_POOL_SIZE=3
|
||||
# For binary data test to work
|
||||
- N8N_RESTRICT_FILE_ACCESS_TO=''
|
||||
- N8N_BLOCK_FILE_ACCESS_TO_N8N_FILES=false
|
||||
# Task Runner config
|
||||
- N8N_RUNNERS_MODE=external
|
||||
- N8N_RUNNERS_BROKER_LISTEN_ADDRESS=0.0.0.0
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user