diff --git a/test/node_redis.spec.js b/test/node_redis.spec.js index 83a44f074d..8937a270c9 100644 --- a/test/node_redis.spec.js +++ b/test/node_redis.spec.js @@ -11,12 +11,20 @@ var fork = require('child_process').fork; var redis = config.redis; var client; +// Currently Travis Windows builds hang after completing if any processes are still running, +// we shutdown redis-server after all tests complete (can't do this in a +// `after_script` Travis hook as it hangs before the `after` life cycles) +// to workaround the issue. +// +// See: https://github.com/travis-ci/travis-ci/issues/8082 after(function (done) { if (process.platform !== 'win32' || !process.env.CI) { return done(); } - require('cross-spawn').sync('redis-server', ['--service-stop'], {}); - done(); + process.nextTick(function () { + require('cross-spawn').sync('redis-server', ['--service-stop'], {}); + done(); + }); }); describe('The node_redis client', function () {