Skip to content
This repository has been archived by the owner on Mar 16, 2022. It is now read-only.

Commit

Permalink
fix(test): increase delay timer
Browse files Browse the repository at this point in the history
  • Loading branch information
h2non committed Oct 15, 2015
1 parent 6822f05 commit d8dd5b1
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 10 deletions.
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,10 @@

**Full-featured**, **pluggable** and **middleware-oriented** **HTTP/S** and **WebSocket proxy** with powerful built-in features such as **versatile routing layer**, **traffic interceptor and replay** to multiple backends, built-in **balancer**, requests **retry/backoff**, **hierarchical configuration** and [more](#features).

**rocky** can be fluently used [programmatically](#programmatic-api) or via [command-line](#command-line) interface.
Built for [node.js](http://nodejs.org)/[io.js](https://iojs.org).
Compatible with [connect](https://github.com/senchalabs/connect)/[express](http://expressjs.com).

**rocky** can be fluently used [programmatically](#programmatic-api) or via [command-line](#command-line) interface.

To get started, take a look to [how does it work](#how-does-it-work), [basic usage](#usage), [middleware layer](#middleware-layer) and [examples](/examples)

Requires node.js +0.12 or io.js +1.6
Expand Down
2 changes: 1 addition & 1 deletion benchmark/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ bash benchmark/run.sh http://rocky.server:8080 200 15s

## Results

Using a Macbook Pro i7 2.7 Ghz 16 GB OSX Yosemite and `node.js@4.1.2`
Using a Macbook Pro i7 2.7 Ghz 16 GB OSX Yosemite and `node.js@4.2.1`

##### Simple forward (100 req/sec)
```
Expand Down
18 changes: 11 additions & 7 deletions test/http.js
Original file line number Diff line number Diff line change
Expand Up @@ -825,7 +825,7 @@ suite('http', function () {
var spy = sinon.spy()
proxy = rocky()
server = createTestServer(spy, 100)
replay = createReplayServer(assertReplay)
replay = createReplayServer(assertReplay, 100)

proxy.post('/test')
.replayAfterForward()
Expand All @@ -847,12 +847,10 @@ suite('http', function () {
})

function assertReplay(req, res) {
setTimeout(function () {
expect(spy.args.length > 0).to.be.true
expect(req.body.length).to.be.equal(body.length)
expect((Date.now() - start) >= 100).to.be.true
done()
}, 1000)
expect(spy.calledOnce).to.be.true
expect(req.body.length).to.be.equal(body.length)
expect((Date.now() - start) >= 100).to.be.true
done()
}
})

Expand Down Expand Up @@ -1293,3 +1291,9 @@ function longString(x) {
}
return s
}

function defer(fn, ms) {
setTimeout(function () {
fn.apply(null, arguments)
}, +ms || 10)
}

0 comments on commit d8dd5b1

Please sign in to comment.