mirror of
https://github.com/nodejs/node-v0.x-archive.git
synced 2026-04-28 03:01:10 -04:00
Add failing test-eio-limit.js
This commit is contained in:
28
test/simple/test-eio-limit.js
Normal file
28
test/simple/test-eio-limit.js
Normal file
@@ -0,0 +1,28 @@
|
||||
var assert = require('assert'),
|
||||
zlib = require('zlib'),
|
||||
started = 0,
|
||||
done = 0;
|
||||
|
||||
function repeat(fn) {
|
||||
if (started != 0) {
|
||||
assert.ok(started - done < 100)
|
||||
}
|
||||
|
||||
process.nextTick(function() {
|
||||
fn();
|
||||
repeat(fn);
|
||||
});
|
||||
}
|
||||
|
||||
repeat(function() {
|
||||
if (started > 1000) return process.exit(0);
|
||||
|
||||
for (var i = 0; i < 30; i++) {
|
||||
started++;
|
||||
var deflate = zlib.createDeflate();
|
||||
deflate.write('123');
|
||||
deflate.flush(function() {
|
||||
done++;
|
||||
});
|
||||
}
|
||||
});
|
||||
Reference in New Issue
Block a user