mirror of
https://github.com/fluencelabs/js-libp2p-interfaces
synced 2025-04-25 15:42:22 +00:00
BREAKING CHANGE: the API is now async / await. See https://github.com/libp2p/interface-stream-muxer/pull/55#issue-275014779 for a summary of the changes.
31 lines
1.0 KiB
JavaScript
31 lines
1.0 KiB
JavaScript
/* eslint-env mocha */
|
|
'use strict'
|
|
|
|
const spawn = require('./spawner')
|
|
|
|
module.exports = (common) => {
|
|
describe('stress test', () => {
|
|
let Muxer
|
|
|
|
beforeEach(async () => {
|
|
Muxer = await common.setup()
|
|
})
|
|
|
|
it('1 stream with 1 msg', () => spawn(Muxer, 1, 1))
|
|
it('1 stream with 10 msg', () => spawn(Muxer, 1, 10))
|
|
it('1 stream with 100 msg', () => spawn(Muxer, 1, 100))
|
|
it('10 streams with 1 msg', () => spawn(Muxer, 10, 1))
|
|
it('10 streams with 10 msg', () => spawn(Muxer, 10, 10))
|
|
it('10 streams with 100 msg', () => spawn(Muxer, 10, 100))
|
|
it('100 streams with 1 msg', () => spawn(Muxer, 100, 1))
|
|
it('100 streams with 10 msg', () => spawn(Muxer, 100, 10))
|
|
it('100 streams with 100 msg', () => spawn(Muxer, 100, 100))
|
|
it('1000 streams with 1 msg', () => spawn(Muxer, 1000, 1))
|
|
it('1000 streams with 10 msg', () => spawn(Muxer, 1000, 10))
|
|
it('1000 streams with 100 msg', function () {
|
|
this.timeout(30 * 1000)
|
|
return spawn(Muxer, 1000, 100)
|
|
})
|
|
})
|
|
}
|