diff options
author | Anna Henningsen <anna@addaleax.net> | 2016-08-01 12:58:24 +0200 |
---|---|---|
committer | Anna Henningsen <anna@addaleax.net> | 2016-08-11 18:42:41 +0200 |
commit | 6d3241d19c89427b79324ce348d7f42dee5b7531 (patch) | |
tree | 9d1abba7f38372d22d55c2bcb0dcccb9f2192cf1 /src/node_util.cc | |
parent | 84f07782470dd515bfc8fcc3f0c70e03848eb593 (diff) | |
download | android-node-v8-6d3241d19c89427b79324ce348d7f42dee5b7531.tar.gz android-node-v8-6d3241d19c89427b79324ce348d7f42dee5b7531.tar.bz2 android-node-v8-6d3241d19c89427b79324ce348d7f42dee5b7531.zip |
test,util: fix flaky test-util-sigint-watchdog
Fix parallel/test-util-sigint-watchdog by polling until the
signal has definitely been received instead of just using a timeout.
Fixes: https://github.com/nodejs/node/issues/7919
PR-URL: https://github.com/nodejs/node/pull/7933
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Diffstat (limited to 'src/node_util.cc')
-rw-r--r-- | src/node_util.cc | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/node_util.cc b/src/node_util.cc index e60af80326..92eed3a9ae 100644 --- a/src/node_util.cc +++ b/src/node_util.cc @@ -113,6 +113,13 @@ void StopSigintWatchdog(const FunctionCallbackInfo<Value>& args) { args.GetReturnValue().Set(had_pending_signals); } + +void WatchdogHasPendingSigint(const FunctionCallbackInfo<Value>& args) { + bool ret = SigintWatchdogHelper::GetInstance()->HasPendingSignal(); + args.GetReturnValue().Set(ret); +} + + void Initialize(Local<Object> target, Local<Value> unused, Local<Context> context) { @@ -138,6 +145,7 @@ void Initialize(Local<Object> target, env->SetMethod(target, "startSigintWatchdog", StartSigintWatchdog); env->SetMethod(target, "stopSigintWatchdog", StopSigintWatchdog); + env->SetMethod(target, "watchdogHasPendingSigint", WatchdogHasPendingSigint); } } // namespace util |