drcariel closed pull request #3545: add timeout.js back URL: https://github.com/apache/incubator-openwhisk/pull/3545
This is a PR merged from a forked repository. As GitHub hides the original diff on merge, it is displayed below for the sake of provenance: As this is a foreign pull request (from a fork), the diff is supplied below (as it won't show otherwise due to GitHub magic): diff --git a/tests/dat/actions/timeout.js b/tests/dat/actions/timeout.js new file mode 100644 index 0000000000..f3bc74b2d2 --- /dev/null +++ b/tests/dat/actions/timeout.js @@ -0,0 +1,18 @@ +function sleep(milliseconds) { + var start = new Date().getTime(); + while (true) { + var now = new Date().getTime(); + if ((now - start) > milliseconds){ + break; + } + } +} + +function main(msg) { + console.log('dosTimeout', 'timeout ' + msg.payload+''); + var n = msg.payload; + sleep(n); + var res = "[OK] message terminated successfully after " + msg.payload + " milliseconds."; + console.log('dosTimeout', 'result:', res); + return {msg: res}; +} ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services