From a963ae1b7d443fa7ce649641cbca04ea01f9d305 Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Sat, 5 Jan 2019 16:21:00 -0800 Subject: [PATCH 1/2] test: tune test-uv-threadpool-schedule test-uv-threadpool-schedule has been failing consistently in node-daily-master CI. It also fails consistently on my personal laptop. These changes make it pass consistently with current master but fail consistently with Node.js 10.11 (which was the last release in the 10.x line before the fix that the test is for). It succeeds/fails as expected whether or not I am connected to the network. Fixes: https://github.com/nodejs/node/issues/25305 --- test/internet/test-uv-threadpool-schedule.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/internet/test-uv-threadpool-schedule.js b/test/internet/test-uv-threadpool-schedule.js index 636364b30f892b..c5b94002da9094 100644 --- a/test/internet/test-uv-threadpool-schedule.js +++ b/test/internet/test-uv-threadpool-schedule.js @@ -15,7 +15,7 @@ const assert = require('assert'); const start = Date.now(); -const slowIOmax = 100; +const slowIOmax = 10; let slowIOcount = 0; let fastIOdone = false; let slowIOend, fastIOend; @@ -37,7 +37,7 @@ function onResolve() { // highly load / platform dependent, so don't be very greedy. const fastIOtime = fastIOend - start; const slowIOtime = slowIOend - start; - const expectedMax = slowIOtime / 100; + const expectedMax = slowIOtime / 10; assert.ok(fastIOtime < expectedMax, 'fast I/O took longer to complete, ' + `actual: ${fastIOtime}, expected: ${expectedMax}`); From ab6cbd411c84a8a995a967851ca4ebdacd45aa01 Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Sat, 5 Jan 2019 17:18:32 -0800 Subject: [PATCH 2/2] fixup! test: tune test-uv-threadpool-schedule --- test/internet/test-uv-threadpool-schedule.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/internet/test-uv-threadpool-schedule.js b/test/internet/test-uv-threadpool-schedule.js index c5b94002da9094..9e61d875f20557 100644 --- a/test/internet/test-uv-threadpool-schedule.js +++ b/test/internet/test-uv-threadpool-schedule.js @@ -15,7 +15,7 @@ const assert = require('assert'); const start = Date.now(); -const slowIOmax = 10; +const slowIOmax = 100; let slowIOcount = 0; let fastIOdone = false; let slowIOend, fastIOend; @@ -31,13 +31,13 @@ function onResolve() { 'fast I/O was throttled due to threadpool congestion.'); // More realistic expectation: finish disc I/O at least within - // a time duration that is 1/100th of net I/O. + // a time duration that is half of net I/O. // Ideally the slow I/O should not affect the fast I/O as those // have two different thread-pool buckets. However, this could be // highly load / platform dependent, so don't be very greedy. const fastIOtime = fastIOend - start; const slowIOtime = slowIOend - start; - const expectedMax = slowIOtime / 10; + const expectedMax = slowIOtime / 2; assert.ok(fastIOtime < expectedMax, 'fast I/O took longer to complete, ' + `actual: ${fastIOtime}, expected: ${expectedMax}`);