Comparing version 1.3.5 to 1.3.6
@@ -10,2 +10,4 @@ const rpc = require('../'); | ||
let nativeNCFails = false; | ||
rpc.FUNCTION_PRIORITY.forEach((fn, i) => { | ||
@@ -22,7 +24,33 @@ test('profile ' + fn.name, () => { | ||
} catch (ex) { | ||
console.log(fn.name + ' fails'); | ||
if (fn.name === 'nativeNC') { | ||
console.log(fn.name + ' fails'); | ||
nativeNCFails = true; | ||
return; | ||
} | ||
throw ex; | ||
} | ||
}); | ||
}); | ||
rpc.FUNCTION_PRIORITY.forEach((fn, i) => { | ||
test('test 30MB ' + fn.name, () => { | ||
let result; | ||
try { | ||
rpc.configuration.fastestFunction = fn; | ||
result = client('big'); | ||
} catch (ex) { | ||
if (fn.name === 'nativeNC' && nativeNCFails) { | ||
console.log(fn.name + ' fails'); | ||
return; | ||
} | ||
throw ex; | ||
} | ||
expect(result.length).toBe(30 * 1024 * 1024, 42); | ||
// for (let i = 0; i < 30 * 1024 * 1024, 42; i++) { | ||
// expect(result[i]).toBe(42); | ||
// } | ||
}); | ||
}); | ||
rpc.FUNCTION_PRIORITY.forEach((fn, i) => { | ||
let longMessage = ''; | ||
@@ -42,5 +70,9 @@ for (let i = 0; i < 100000; i++) { | ||
} catch (ex) { | ||
console.log('large ' + fn.name + ' fails'); | ||
if (fn.name === 'nativeNC' && nativeNCFails) { | ||
console.log('large ' + fn.name + ' fails'); | ||
return; | ||
} | ||
throw ex; | ||
} | ||
}); | ||
}); |
@@ -95,3 +95,7 @@ 'use strict'; | ||
function nativeNC(port, input) { | ||
return spawnSync('nc', [host, port], {input: input, windowsHide: true}); | ||
return spawnSync('nc', [host, port], { | ||
input: input, | ||
windowsHide: true, | ||
maxBuffer: Infinity, | ||
}); | ||
} | ||
@@ -102,5 +106,12 @@ | ||
if (src.length < 1000) { | ||
return spawnSync(process.execPath, ['-e', src], {windowsHide: true}); | ||
return spawnSync(process.execPath, ['-e', src], { | ||
windowsHide: true, | ||
maxBuffer: Infinity, | ||
}); | ||
} else { | ||
return spawnSync(process.execPath, [], {input: src, windowsHide: true}); | ||
return spawnSync(process.execPath, [], { | ||
input: src, | ||
windowsHide: true, | ||
maxBuffer: Infinity, | ||
}); | ||
} | ||
@@ -107,0 +118,0 @@ } |
function init(connection) { | ||
return function(message) { | ||
if (message === 'big') { | ||
return Promise.resolve(Buffer.alloc(30 * 1024 * 1024, 42)); | ||
} | ||
return Promise.resolve('sent ' + message + ' to ' + connection); | ||
@@ -4,0 +7,0 @@ }; |
{ | ||
"name": "sync-rpc", | ||
"version": "1.3.5", | ||
"version": "1.3.6", | ||
"main": "lib/index.js", | ||
@@ -5,0 +5,0 @@ "description": "Run asynchronous commands synchronously by putting them in a separate process", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
14559
362