-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
19 - Adds frame max negotiation (#125)
* Adds frame max negotiation * Fix unlimited frame max setting * fix: use get property instead of method to retrieve current frameMax value in connection * fix: rename constants related to frameMax parameter * remove useless comments --------- Co-authored-by: magne <magnello@coders51.com> Co-authored-by: Igor Cappello <igor.cappello@gmail.com> Co-authored-by: Alberto Barrilá <alberto.barrila@gmail.com>
- Loading branch information
1 parent
c08b348
commit 4282389
Showing
5 changed files
with
61 additions
and
9 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
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,38 @@ | ||
import { expect } from "chai" | ||
import { createConnection } from "../support/fake_data" | ||
import { Rabbit } from "../support/rabbit" | ||
import { eventually, username, password } from "../support/util" | ||
|
||
describe("connect frame size negotiation", () => { | ||
const rabbit = new Rabbit(username, password) | ||
|
||
it("using 65536 as frameMax", async () => { | ||
const frameMax = 65536 | ||
|
||
const connection = await createConnection(username, password, undefined, frameMax) | ||
|
||
await eventually(async () => { | ||
expect(connection.currentFrameMax).lte(frameMax) | ||
expect(await rabbit.getConnections()).lengthOf(1) | ||
}, 5000) | ||
try { | ||
await connection.close() | ||
await rabbit.closeAllConnections() | ||
} catch (e) {} | ||
}).timeout(10000) | ||
|
||
it("using 1024 as frameMax", async () => { | ||
const frameMax = 1024 | ||
|
||
const connection = await createConnection(username, password, undefined, frameMax) | ||
|
||
await eventually(async () => { | ||
expect(connection.currentFrameMax).lte(frameMax) | ||
expect(await rabbit.getConnections()).lengthOf(1) | ||
}, 5000) | ||
try { | ||
await connection.close() | ||
await rabbit.closeAllConnections() | ||
} catch (e) {} | ||
}).timeout(10000) | ||
}) |
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