Updated tests timeout, we have more accurate timers, avatar.js run slower, need to increase delay in some tests.

This commit is contained in:
jfdenise 2013-10-24 15:13:38 +02:00
parent 804927eaa3
commit a844d9035a
12 changed files with 127 additions and 16 deletions

2
.gitignore vendored
View File

@ -30,6 +30,7 @@ atlassian-ide-plugin.xml
*.vcxproj
*.vcxproj.filters
src/main/js/lib/_linklist.js
src/main/js/lib/_stream_duplex.js
src/main/js/lib/_stream_passthrough.js
src/main/js/lib/_stream_readable.js
@ -56,6 +57,7 @@ src/main/js/lib/querystring.js
src/main/js/lib/readline.js
src/main/js/lib/stream.js
src/main/js/lib/string_decoder.js
src/main/js/lib/timers.js
src/main/js/lib/tls.js
src/main/js/lib/tty.js
src/main/js/lib/url.js

View File

@ -287,10 +287,13 @@
<apply-diff src="test/simple" mod="${test.dir}/simple" name="test-child-process-fork-exec-argv.js"/>
<apply-diff src="test/simple" mod="${test.dir}/simple" name="test-dgram-address.js"/>
<apply-diff src="test/simple" mod="${test.dir}/simple" name="test-dgram-ref.js"/>
<apply-diff src="test/simple" mod="${test.dir}/simple" name="test-dgram-udp4.js"/>
<apply-diff src="test/simple" mod="${test.dir}/simple" name="test-dgram-unref.js"/>
<apply-diff src="test/simple" mod="${test.dir}/simple" name="test-error-reporting.js"/>
<apply-diff src="test/simple" mod="${test.dir}/simple" name="test-fs-readfile-pipe.js"/>
<apply-diff src="test/simple" mod="${test.dir}/simple" name="test-http.js"/>
<apply-diff src="test/simple" mod="${test.dir}/simple" name="test-http-client-timeout-agent.js"/>
<apply-diff src="test/simple" mod="${test.dir}/simple" name="test-http-default-encoding.js"/>
<apply-diff src="test/simple" mod="${test.dir}/simple" name="test-http-end-throw-socket-handling.js"/>
<apply-diff src="test/simple" mod="${test.dir}/simple" name="test-http-head-request.js"/>
<apply-diff src="test/simple" mod="${test.dir}/simple" name="test-http-many-ended-pipelines.js"/>
@ -299,14 +302,17 @@
<apply-diff src="test/simple" mod="${test.dir}/simple" name="test-module-loading.js"/>
<apply-diff src="test/simple" mod="${test.dir}/simple" name="test-net-pingpong.js"/>
<apply-diff src="test/simple" mod="${test.dir}/simple" name="test-net-server-address.js"/>
<apply-diff src="test/simple" mod="${test.dir}/simple" name="test-net-server-unref.js"/>
<apply-diff src="test/simple" mod="${test.dir}/simple" name="test-net-settimeout.js"/>
<apply-diff src="test/simple" mod="${test.dir}/simple" name="test-net-write-slow.js"/>
<apply-diff src="test/simple" mod="${test.dir}/simple" name="test-next-tick.js"/>
<apply-diff src="test/simple" mod="${test.dir}/simple" name="test-next-tick-starvation.js"/>
<apply-diff src="test/simple" mod="${test.dir}/simple" name="test-os.js"/>
<apply-diff src="test/simple" mod="${test.dir}/simple" name="test-process-exec-argv.js"/>
<apply-diff src="test/simple" mod="${test.dir}/simple" name="test-pipe-head.js"/>
<apply-diff src="test/simple" mod="${test.dir}/simple" name="test-pipe-unref.js"/>
<apply-diff src="test/simple" mod="${test.dir}/simple" name="test-readline-interface.js"/>
<apply-diff src="test/simple" mod="${test.dir}/simple" name="test-script-context.js"/>
<apply-diff src="test/simple" mod="${test.dir}/simple" name="test-stream2-push.js"/>
<apply-diff src="test/simple" mod="${test.dir}/simple" name="test-stream2-read-sync-stack.js"/>
<apply-diff src="test/simple" mod="${test.dir}/simple" name="test-string-decoder.js"/>
<apply-diff src="test/simple" mod="${test.dir}/simple" name="test-timers-unref.js"/>
@ -345,10 +351,13 @@
<apply-patch-file target="${test.dir}/simple" name="test-child-process-fork-exec-argv.js"/>
<apply-patch-file target="${test.dir}/simple" name="test-dgram-address.js"/>
<apply-patch-file target="${test.dir}/simple" name="test-dgram-ref.js"/>
<apply-patch-file target="${test.dir}/simple" name="test-dgram-udp4.js"/>
<apply-patch-file target="${test.dir}/simple" name="test-dgram-unref.js"/>
<apply-patch-file target="${test.dir}/simple" name="test-error-reporting.js"/>
<apply-patch-file target="${test.dir}/simple" name="test-fs-readfile-pipe.js"/>
<apply-patch-file target="${test.dir}/simple" name="test-http.js"/>
<apply-patch-file target="${test.dir}/simple" name="test-http-client-timeout-agent.js"/>
<apply-patch-file target="${test.dir}/simple" name="test-http-default-encoding.js"/>
<apply-patch-file target="${test.dir}/simple" name="test-http-end-throw-socket-handling.js"/>
<apply-patch-file target="${test.dir}/simple" name="test-http-head-request.js"/>
<apply-patch-file target="${test.dir}/simple" name="test-http-many-ended-pipelines.js"/>
@ -357,14 +366,17 @@
<apply-patch-file target="${test.dir}/simple" name="test-module-loading.js"/>
<apply-patch-file target="${test.dir}/simple" name="test-net-pingpong.js"/>
<apply-patch-file target="${test.dir}/simple" name="test-net-server-address.js"/>
<apply-patch-file target="${test.dir}/simple" name="test-net-server-unref.js"/>
<apply-patch-file target="${test.dir}/simple" name="test-net-settimeout.js"/>
<apply-patch-file target="${test.dir}/simple" name="test-net-write-slow.js"/>
<apply-patch-file target="${test.dir}/simple" name="test-next-tick.js"/>
<apply-patch-file target="${test.dir}/simple" name="test-next-tick-starvation.js"/>
<apply-patch-file target="${test.dir}/simple" name="test-os.js"/>
<apply-patch-file target="${test.dir}/simple" name="test-process-exec-argv.js"/>
<apply-patch-file target="${test.dir}/simple" name="test-pipe-head.js"/>
<apply-patch-file target="${test.dir}/simple" name="test-pipe-unref.js"/>
<apply-patch-file target="${test.dir}/simple" name="test-readline-interface.js"/>
<apply-patch-file target="${test.dir}/simple" name="test-script-context.js"/>
<apply-patch-file target="${test.dir}/simple" name="test-stream2-push.js"/>
<apply-patch-file target="${test.dir}/simple" name="test-stream2-read-sync-stack.js"/>
<apply-patch-file target="${test.dir}/simple" name="test-string-decoder.js"/>
<apply-patch-file target="${test.dir}/simple" name="test-timers-unref.js"/>

View File

@ -0,0 +1,8 @@
--- ../node/test/simple/test-dgram-udp4.js 2013-09-23 13:54:04.000000000 +0200
+++ test/simple/test-dgram-udp4.js 2013-10-24 14:16:22.000000000 +0200
@@ -78,4 +78,4 @@
timer = setTimeout(function() {
throw new Error('Timeout');
-}, 200);
+}, 2000);

View File

@ -0,0 +1,21 @@
--- ../node/test/simple/test-dgram-unref.js 2013-10-24 14:37:12.000000000 +0200
+++ test/simple/test-dgram-unref.js 2013-10-24 14:38:34.000000000 +0200
@@ -28,11 +28,16 @@
var s = dgram.createSocket('udp4');
s.bind();
s.unref();
-
+//This timeout is fired because, when the uvLoop.run is called,
+//the unrefed timer is concidered has having timeouted and it is fired.
+//An unrefed timeout that has timeouted is executed.
+//The problem is that it takes 5 seconds from new LoopHandle and uvLoop.runNoWait.
+//Un unrefed timer is concidered timeouted if its timeout is smaller than 5 seconds.
+//We can change the delay, it will not affect the overall time of the test.
setTimeout(function() {
closed = true;
s.close();
-}, 1000).unref();
+}, 7000).unref();
process.on('exit', function() {
assert.strictEqual(closed, false, 'Unrefd socket should not hold loop open');

View File

@ -0,0 +1,11 @@
--- ../node/test/simple/test-http-default-encoding.js 2013-09-23 13:54:04.000000000 +0200
+++ test/simple/test-http-default-encoding.js 2013-10-24 14:18:45.000000000 +0200
@@ -37,7 +37,7 @@
var timeout = setTimeout(function() {
process.exit(1);
- }, 100);
+ }, 1000);
res.writeHead(200);
res.end('hello world\n');

View File

@ -1,5 +1,5 @@
--- //Users/jfdenise/workspaces/latest/node/test/simple/test-http-end-throw-socket-handling.js 2013-08-05 09:41:31.000000000 +0200
+++ node/test/simple/test-http-end-throw-socket-handling.js 2013-08-07 16:47:57.000000000 +0200
--- ../node/test/simple/test-http-end-throw-socket-handling.js 2013-09-23 13:54:04.000000000 +0200
+++ test/simple/test-http-end-throw-socket-handling.js 2013-10-24 13:52:31.000000000 +0200
@@ -50,10 +50,11 @@
}
});

View File

@ -0,0 +1,20 @@
--- ../node/test/simple/test-net-server-unref.js 2013-09-23 13:54:04.000000000 +0200
+++ test/simple/test-net-server-unref.js 2013-10-24 14:43:31.000000000 +0200
@@ -29,10 +29,16 @@
s.listen();
s.unref();
+//This timeout is fired because, when the uvLoop.run is called,
+//the unrefed timer is concidered has having timeouted and it is fired.
+//An unrefed timeout that has timeouted is executed.
+//The problem is that it takes 5 seconds from new LoopHandle and uvLoop.runNoWait.
+//Un unrefed timer is concidered timeouted if its timeout is smaller than 5 seconds.
+//We can change the delay, it will not affect the overall time of the test.
setTimeout(function() {
closed = true;
s.close();
-}, 1000).unref();
+}, 7000).unref();
process.on('exit', function() {
assert.strictEqual(closed, false, 'Unrefd socket should not hold loop open');

View File

@ -0,0 +1,11 @@
--- ../node/test/simple/test-net-settimeout.js 2013-09-23 13:54:04.000000000 +0200
+++ test/simple/test-net-settimeout.js 2013-10-24 14:23:32.000000000 +0200
@@ -26,7 +26,7 @@
var net = require('net');
var assert = require('assert');
-var T = 100;
+var T = 1000;
var server = net.createServer(function(c) {
c.write('hello');

View File

@ -1,11 +0,0 @@
--- ../node-v10/test/simple/test-next-tick-starvation.js 2013-04-30 22:00:43.509305626 -0700
+++ node/test/simple/test-next-tick-starvation.js 2013-05-28 13:57:11.682839454 -0700
@@ -44,7 +44,7 @@
}
spin();
-setTimeout(onTimeout, 50);
+setTimeout(onTimeout, 1);
process.on('exit', function() {
assert.ok(ran);

View File

@ -0,0 +1,20 @@
--- ../node/test/simple/test-pipe-unref.js 2013-09-23 13:54:04.000000000 +0200
+++ test/simple/test-pipe-unref.js 2013-10-24 14:43:59.000000000 +0200
@@ -29,10 +29,16 @@
s.listen(common.PIPE);
s.unref();
+//This timeout is fired because, when the uvLoop.run is called,
+//the unrefed timer is concidered has having timeouted and it is fired.
+//An unrefed timeout that has timeouted is executed.
+//The problem is that it takes 5 seconds from new LoopHandle and uvLoop.runNoWait.
+//Un unrefed timer is concidered timeouted if its timeout is smaller than 5 seconds.
+//We can change the delay, it will not affect the overall time of the test.
setTimeout(function() {
closed = true;
s.close();
-}, 1000).unref();
+}, 7000).unref();
process.on('exit', function() {
assert.strictEqual(closed, false, 'Unrefd socket should not hold loop open');

View File

@ -0,0 +1,18 @@
--- ../node/test/simple/test-stream2-push.js 2013-09-23 13:54:04.000000000 +0200
+++ test/simple/test-stream2-push.js 2013-10-24 14:56:52.000000000 +0200
@@ -117,7 +117,7 @@
source.emit('data', chunk);
assert(!reading);
if (set++ < 5)
- setTimeout(data, 10);
+ setTimeout(data, 100);
else
end();
}
@@ -134,5 +134,5 @@
writer.end(stream.read());
setTimeout(function() {
assert(ended);
- });
+ }, 100);
}

View File

@ -349,7 +349,6 @@ source.test.simple.list = \
test-next-tick-errors.js \
test-next-tick-ordering.js \
test-next-tick-ordering2.js \
test-next-tick-starvation.js \
test-os.js \
test-path.js \
test-path-makelong.js \