diff --git a/patches/node/.patches b/patches/node/.patches index 2986743ef177..94f53f55a07e 100644 --- a/patches/node/.patches +++ b/patches/node/.patches @@ -40,3 +40,4 @@ fix_extern_the_nativemoduleenv_and_options_parser_for_debug_builds.patch chore_read_nobrowserglobals_from_global_not_process.patch chore_split_createenvironment_into_createenvironment_and.patch chore_handle_default_configuration_not_being_set_in_the_electron_env.patch +fix_set_uptime_offset_in_correct_init_method.patch \ No newline at end of file diff --git a/patches/node/fix_set_uptime_offset_in_correct_init_method.patch b/patches/node/fix_set_uptime_offset_in_correct_init_method.patch new file mode 100644 index 000000000000..228be379932b --- /dev/null +++ b/patches/node/fix_set_uptime_offset_in_correct_init_method.patch @@ -0,0 +1,29 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Micha Hanselmann +Date: Wed, 24 Jul 2019 11:44:25 -0700 +Subject: fix: set uptime offset in correct init method + +This patch can be removed after 'https://github.com/nodejs/node/pull/28849' landed here. + +diff --git a/src/node.cc b/src/node.cc +index 707579c8254903f5c587fa42711eb5d0184b4112..64f46faa36a7b52d86b257adad6c54b93b894262 100644 +--- a/src/node.cc ++++ b/src/node.cc +@@ -743,6 +743,9 @@ int InitializeNodeWithArgs(std::vector* argv, + // Make sure InitializeNodeWithArgs() is called only once. + CHECK(!init_called.exchange(true)); + ++ // Initialize node_start_time to get relative uptime. ++ per_process::node_start_time = uv_hrtime(); ++ + // Register built-in modules + binding::RegisterBuiltinModules(); + +@@ -929,7 +932,6 @@ void Init(int* argc, + InitializationResult InitializeOncePerProcess(int argc, char** argv) { + atexit(ResetStdio); + PlatformInit(); +- per_process::node_start_time = uv_hrtime(); + + CHECK_GT(argc, 0); + diff --git a/script/node-disabled-tests.json b/script/node-disabled-tests.json index 4e61f19ffa03..cf09748523cc 100644 --- a/script/node-disabled-tests.json +++ b/script/node-disabled-tests.json @@ -79,7 +79,6 @@ "parallel/test-process-exec-argv", "parallel/test-process-external-stdio-close", "parallel/test-process-external-stdio-close-spawn", - "parallel/test-process-uptime", "parallel/test-process-versions", "parallel/test-readline-interface", "parallel/test-inspector-esm",