From d68f946fe4ebaba02d68f5b118d53ec397ac705e Mon Sep 17 00:00:00 2001 From: Benjamin Gruenbaum Date: Thu, 26 Jul 2018 17:05:48 +0300 Subject: [PATCH] test: remove unused config process.maxTickDepth was removed in v0.12 a whole while ago and was mostly removed from our code base. There are still some places it was left in old benchmarks and tests. This PR removes setting the value in those tests and benchmarks. PR-URL: https://github.com/nodejs/node/pull/21985 Reviewed-By: Anatoli Papirovski Reviewed-By: Refael Ackermann Reviewed-By: Colin Ihrig Reviewed-By: Luigi Pinca Reviewed-By: Anna Henningsen Reviewed-By: Ruben Bridgewater Reviewed-By: Trivikram Kamat Reviewed-By: James M Snell Reviewed-By: Jon Moss --- benchmark/process/next-tick-depth-args.js | 2 -- benchmark/process/next-tick-depth.js | 2 -- test/parallel/test-next-tick-intentional-starvation.js | 8 ++------ test/parallel/test-stream2-read-sync-stack.js | 8 ++++---- test/sequential/test-next-tick-error-spin.js | 1 - 5 files changed, 6 insertions(+), 15 deletions(-) diff --git a/benchmark/process/next-tick-depth-args.js b/benchmark/process/next-tick-depth-args.js index a7670d99efc..da61f90a647 100644 --- a/benchmark/process/next-tick-depth-args.js +++ b/benchmark/process/next-tick-depth-args.js @@ -5,8 +5,6 @@ const bench = common.createBenchmark(main, { n: [12e6] }); -process.maxTickDepth = Infinity; - function main({ n }) { let counter = n; function cb4(arg1, arg2, arg3, arg4) { diff --git a/benchmark/process/next-tick-depth.js b/benchmark/process/next-tick-depth.js index 1ad32c80618..c88e042b965 100644 --- a/benchmark/process/next-tick-depth.js +++ b/benchmark/process/next-tick-depth.js @@ -4,8 +4,6 @@ const bench = common.createBenchmark(main, { n: [12e6] }); -process.maxTickDepth = Infinity; - function main({ n }) { let counter = n; bench.start(); diff --git a/test/parallel/test-next-tick-intentional-starvation.js b/test/parallel/test-next-tick-intentional-starvation.js index fdcdd6a7a60..26d07e02eaa 100644 --- a/test/parallel/test-next-tick-intentional-starvation.js +++ b/test/parallel/test-next-tick-intentional-starvation.js @@ -23,12 +23,8 @@ require('../common'); const assert = require('assert'); -// this is the inverse of test-next-tick-starvation. -// it verifies that process.nextTick will *always* come before other -// events, up to the limit of the process.maxTickDepth value. - -// WARNING: unsafe! -process.maxTickDepth = Infinity; +// this is the inverse of test-next-tick-starvation. it verifies +// that process.nextTick will *always* come before other events let ran = false; let starved = false; diff --git a/test/parallel/test-stream2-read-sync-stack.js b/test/parallel/test-stream2-read-sync-stack.js index 3fa84547fe2..e6a5ea7e521 100644 --- a/test/parallel/test-stream2-read-sync-stack.js +++ b/test/parallel/test-stream2-read-sync-stack.js @@ -22,13 +22,13 @@ 'use strict'; const common = require('../common'); const Readable = require('stream').Readable; + +// This tests synchronous read callbacks and verifies that even if they nest +// heavily the process handles it without an error + const r = new Readable(); const N = 256 * 1024; -// Go ahead and allow the pathological case for this test. -// Yes, it's an infinite loop, that's the point. -process.maxTickDepth = N + 2; - let reads = 0; r._read = function(n) { const chunk = reads++ === N ? null : Buffer.allocUnsafe(1); diff --git a/test/sequential/test-next-tick-error-spin.js b/test/sequential/test-next-tick-error-spin.js index 565cdb458cf..70d924cfa34 100644 --- a/test/sequential/test-next-tick-error-spin.js +++ b/test/sequential/test-next-tick-error-spin.js @@ -39,7 +39,6 @@ if (process.argv[2] !== 'child') { const domain = require('domain'); const d = domain.create(); - process.maxTickDepth = 10; // in the error handler, we trigger several MakeCallback events d.on('error', function() {