From c402dc77b58b1d0673ddc5c3f4f3f0e2c53f7ecc Mon Sep 17 00:00:00 2001 From: fengmk2 Date: Fri, 23 Feb 2024 13:31:18 +0800 Subject: [PATCH] f --- test/cfork.test.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/test/cfork.test.js b/test/cfork.test.js index df8beb2..915eb81 100644 --- a/test/cfork.test.js +++ b/test/cfork.test.js @@ -108,7 +108,7 @@ describe('test/cfork.test.js', () => { const text = body.toString(); // console.log('%o', text); assert(text === 'worker index: 0, 4' || text === 'worker index: 1, 4' - || text === 'worker index: 2, 4 ' || text === 'worker index: 3, 4', text); + || text === 'worker index: 2, 4' || text === 'worker index: 3, 4', text); resp.statusCode.should.equal(200); urllib.request('http://localhost:1985/worker_index', function (err, body, resp) { should.ifError(err); @@ -132,7 +132,12 @@ describe('test/cfork.test.js', () => { urllib.request('http://localhost:1984/async_error', function (err) { console.error('[cfork.test.js] get /async_error error: %s', err); should.exist(err); - err.message.should.containEql('socket hang up'); + // ECONNRESET on windows + if (process.platform === 'win32') { + err.message.should.containEql('ECONNRESET'); + } else { + err.message.should.containEql('socket hang up'); + } done(); });