summaryrefslogtreecommitdiff
path: root/test/pummel/test-keep-alive.js
diff options
context:
space:
mode:
authorRyan Dahl <ry@tinyclouds.org>2010-07-15 11:47:25 -0700
committerRyan Dahl <ry@tinyclouds.org>2010-07-15 14:21:31 -0700
commit9fd5e3c89cb3664be7491c2da8e7060a0c36e135 (patch)
treed748de58c1638e852d33374c328a45f6ab8d2268 /test/pummel/test-keep-alive.js
parent94728125696ce05f5308ccbc111874e9fa936936 (diff)
downloadandroid-node-v8-9fd5e3c89cb3664be7491c2da8e7060a0c36e135.tar.gz
android-node-v8-9fd5e3c89cb3664be7491c2da8e7060a0c36e135.tar.bz2
android-node-v8-9fd5e3c89cb3664be7491c2da8e7060a0c36e135.zip
Update tests to work with module contexts
Diffstat (limited to 'test/pummel/test-keep-alive.js')
-rw-r--r--test/pummel/test-keep-alive.js7
1 files changed, 4 insertions, 3 deletions
diff --git a/test/pummel/test-keep-alive.js b/test/pummel/test-keep-alive.js
index 42867831b9..d2980e15ed 100644
--- a/test/pummel/test-keep-alive.js
+++ b/test/pummel/test-keep-alive.js
@@ -1,5 +1,6 @@
// This test requires the program "ab"
-require("../common");
+common = require("../common");
+assert = common.assert
http = require("http");
exec = require("child_process").exec;
@@ -18,7 +19,7 @@ var normalReqSec = 0;
function runAb(opts, callback) {
- var command = "ab " + opts + " http://127.0.0.1:" + PORT + "/";
+ var command = "ab " + opts + " http://127.0.0.1:" + common.PORT + "/";
exec(command, function (err, stdout, stderr) {
if (err) {
console.log("ab not installed? skipping test.\n" + stderr);
@@ -41,7 +42,7 @@ function runAb(opts, callback) {
});
}
-server.listen(PORT, function () {
+server.listen(common.PORT, function () {
runAb("-k -c 100 -t 2", function (reqSec, keepAliveRequests) {
keepAliveReqSec = reqSec;
assert.equal(true, keepAliveRequests > 0);