From 88da5ce5190cb6b15df0825d6ebacdb6dc0ea921 Mon Sep 17 00:00:00 2001 From: Hans Date: Sat, 23 Jul 2022 01:55:04 +0800 Subject: [PATCH] test(Server): tune test data size --- test/cases/http-pipe-body-stream-later-1.js | 2 +- test/cases/http-pipe-body-stream-later-2.js | 2 +- test/cases/http-pipe-body-stream.js | 2 +- test/cases/http-post-multipart.js | 2 +- test/prepare/http.js | 2 +- test/prepare/https.js | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/test/cases/http-pipe-body-stream-later-1.js b/test/cases/http-pipe-body-stream-later-1.js index 0213a59..01b6a44 100644 --- a/test/cases/http-pipe-body-stream-later-1.js +++ b/test/cases/http-pipe-body-stream-later-1.js @@ -1,7 +1,7 @@ const axios = require('axios') module.exports = async function ({ HTTP_PORT }) { - const body = '__TEST__STRING__'.repeat(4096) + const body = '__TEST__STRING__'.repeat(512) const res = await axios.post(`http://localhost:${HTTP_PORT}/stream/body-later-1`, body) if (res.status !== 200) { diff --git a/test/cases/http-pipe-body-stream-later-2.js b/test/cases/http-pipe-body-stream-later-2.js index 7d10502..9ade404 100644 --- a/test/cases/http-pipe-body-stream-later-2.js +++ b/test/cases/http-pipe-body-stream-later-2.js @@ -1,7 +1,7 @@ const axios = require('axios') module.exports = async function ({ HTTP_PORT }) { - const body = '__TEST__STRING__'.repeat(4096) + const body = '__TEST__STRING__'.repeat(512) const res = await axios.post(`http://localhost:${HTTP_PORT}/stream/body-later-2`, body) if (res.status !== 200) { diff --git a/test/cases/http-pipe-body-stream.js b/test/cases/http-pipe-body-stream.js index 413df6d..c3551d6 100644 --- a/test/cases/http-pipe-body-stream.js +++ b/test/cases/http-pipe-body-stream.js @@ -1,7 +1,7 @@ const axios = require('axios') module.exports = async function ({ HTTP_PORT }) { - const body = '__TEST__STRING__'.repeat(4096) + const body = '__TEST__STRING__'.repeat(512) const res = await axios.post(`http://localhost:${HTTP_PORT}/stream/body`, body) if (res.status !== 200) { diff --git a/test/cases/http-post-multipart.js b/test/cases/http-post-multipart.js index 5d28f05..95d955e 100644 --- a/test/cases/http-post-multipart.js +++ b/test/cases/http-post-multipart.js @@ -2,7 +2,7 @@ const axios = require('axios') const FormData = require('form-data') module.exports = async function ({ HTTP_PORT }) { - const fileSize = 10240 + const fileSize = 512 const form = new FormData() form.append('file', Buffer.alloc(fileSize).fill(0)) const res = await axios({ diff --git a/test/prepare/http.js b/test/prepare/http.js index 368e2b0..7aee9d5 100644 --- a/test/prepare/http.js +++ b/test/prepare/http.js @@ -6,7 +6,7 @@ module.exports = function (port) { return new Promise((resolve, reject) => { try { app(new fastWS({ - bodySize: '1mb', + bodySize: '10kb', logLevel: 'verbose', cache: new LRUCache({ ttl: 1000 * 60 * 5, diff --git a/test/prepare/https.js b/test/prepare/https.js index de8ce16..12ff0fd 100644 --- a/test/prepare/https.js +++ b/test/prepare/https.js @@ -27,7 +27,7 @@ module.exports = function (port) { fs.writeFileSync(cert_file_name, cert.cert) try { app(new fastWS({ - bodySize: '1mb', + bodySize: '10kb', logLevel: 'verbose', ssl: { key_file_name,