This repository has been archived by the owner on Oct 23, 2023. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 135
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use child_process to have fresh express process for each test
- Loading branch information
1 parent
6d24ffd
commit 8458993
Showing
3 changed files
with
76 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
'use strict'; | ||
var child_process = require('child_process'); | ||
|
||
var child; | ||
function startChild() { | ||
console.log('starting child'); | ||
child = child_process.spawn('node', ['express-patient.js']); | ||
child.stdout.pipe(process.stdout); | ||
child.stderr.pipe(process.stderr); | ||
child.on('exit', function () { | ||
console.log('child exited'); | ||
startChild(); | ||
}); | ||
} | ||
|
||
startChild(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,39 @@ | ||
#!/bin/sh | ||
ab -c 5 -n 10000 localhost:3000/hello | ||
curl localhost:3000/gc | ||
ab -c 5 -n 10000 localhost:3000/context/basic | ||
curl localhost:3000/gc | ||
ab -c 5 -n 10000 localhost:3000/breadcrumbs/capture | ||
curl localhost:3000/gc | ||
ab -c 5 -n 10000 localhost:3000/breadcrumbs/auto/console | ||
curl localhost:3000/gc | ||
ab -c 5 -n 10000 localhost:3000/breadcrumbs/auto/http | ||
curl localhost:3000/gc | ||
|
||
ab -c 5 -n 10000 localhost:3000/hello?doError=true | ||
curl localhost:3000/gc | ||
ab -c 5 -n 10000 localhost:3000/context/basic?doError=true | ||
curl localhost:3000/gc | ||
ab -c 5 -n 10000 localhost:3000/breadcrumbs/capture?doError=true | ||
curl localhost:3000/gc | ||
ab -c 5 -n 10000 localhost:3000/breadcrumbs/auto/console?doError=true | ||
curl localhost:3000/gc | ||
ab -c 5 -n 10000 localhost:3000/breadcrumbs/auto/http?doError=true | ||
curl localhost:3000/gc | ||
gc_restart() { | ||
sleep 1 | ||
curl localhost:3000/gc | ||
sleep 1 | ||
curl localhost:3000/shutdown | ||
sleep 1 | ||
} | ||
|
||
ab -c 5 -n 5000 localhost:3000/hello | ||
gc_restart | ||
|
||
ab -c 5 -n 5000 localhost:3000/context/basic | ||
gc_restart | ||
|
||
ab -c 5 -n 5000 localhost:3000/breadcrumbs/capture | ||
gc_restart | ||
|
||
ab -c 5 -n 5000 localhost:3000/breadcrumbs/auto/console | ||
gc_restart | ||
|
||
ab -c 5 -n 5000 localhost:3000/breadcrumbs/auto/http | ||
gc_restart | ||
|
||
|
||
ab -c 5 -n 5000 localhost:3000/hello?doError=true | ||
gc_restart | ||
|
||
ab -c 5 -n 5000 localhost:3000/context/basic?doError=true | ||
gc_restart | ||
|
||
ab -c 5 -n 5000 localhost:3000/breadcrumbs/capture?doError=true | ||
gc_restart | ||
|
||
ab -c 5 -n 5000 localhost:3000/breadcrumbs/auto/console?doError=true | ||
gc_restart | ||
|
||
ab -c 5 -n 5000 localhost:3000/breadcrumbs/auto/http?doError=true | ||
gc_restart |