Skip to content

Commit

Permalink
Address use/reference of startingTps where not correct (#1578)
Browse files Browse the repository at this point in the history
Signed-off-by: Dave Kelsey <[email protected]>
  • Loading branch information
Dave Kelsey authored May 30, 2024
1 parent 56ecafa commit 44b3c52
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 11 deletions.
8 changes: 4 additions & 4 deletions packages/caliper-core/test/worker/rate-control/fixedLoad.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,28 +49,28 @@ describe('fixedLoad controller implementation', () => {
testMessage = new TestMessage('test', [], msgContent);
});

it('should set the sleep time for a single worker if a single worker is specified and the startingTps is not specified', () => {
it('should set the sleep time for a single worker if a single worker is specified and the startTps is not specified', () => {
testMessage.content.rateControl.opts = {};
testMessage.content.totalWorkers = 1;
controller = new FixedLoad.createRateController(testMessage, {}, 0);
controller.sleepTime.should.equal(200);
});

it('should set the sleep time for a single worker if no workers are specified and the startingTps is specified', () => {
it('should set the sleep time for a single worker if no workers are specified and the startTps is specified', () => {
testMessage.content.rateControl.opts = { startTps: 50 };
testMessage.content.totalWorkers = 1;
controller = new FixedLoad.createRateController(testMessage, {}, 0);
controller.sleepTime.should.equal(20);
});

it('should set the sleep time for a multiple workers it the startingTps is not specified', () => {
it('should set the sleep time for a multiple workers it the startTps is not specified', () => {
testMessage.content.rateControl.opts = {};
testMessage.content.totalWorkers = 2;
controller = new FixedLoad.createRateController(testMessage, {}, 0);
controller.sleepTime.should.equal(400);
});

it('should set the sleep time for a multiple workers if the startingTps is specified', () => {
it('should set the sleep time for a multiple workers if the startTps is specified', () => {
testMessage.content.rateControl.opts = { startTps: 50 };
testMessage.content.totalWorkers = 2;
controller = new FixedLoad.createRateController(testMessage, {}, 0);
Expand Down
8 changes: 4 additions & 4 deletions packages/caliper-core/test/worker/rate-control/maxRate.js
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ describe('maxRate controller implementation', () => {
label: 'query2',
rateControl: {
type: 'maximum-rate',
opts: { startingTps: 20, finishingTps: 80 }
opts: {}
},
workload: {
module:'./../queryByChannel.js'
Expand Down Expand Up @@ -271,7 +271,7 @@ describe('maxRate controller implementation', () => {
label: 'query2',
rateControl: {
type: 'maximum-rate',
opts: { startingTps: 20, finishingTps: 80 }
opts: {}
},
workload: {
module:'./../queryByChannel.js'
Expand Down Expand Up @@ -319,7 +319,7 @@ describe('maxRate controller implementation', () => {
label: 'query2',
rateControl: {
type: 'maximum-rate',
opts: { startingTps: 20, finishingTps: 80 }
opts: {}
},
workload: {
module:'./../queryByChannel.js'
Expand Down Expand Up @@ -361,7 +361,7 @@ describe('maxRate controller implementation', () => {
label: 'query2',
rateControl: {
type: 'maximum-rate',
opts: { startingTps: 20, finishingTps: 80 }
opts: {}
},
workload: {
module:'./../queryByChannel.js'
Expand Down
4 changes: 2 additions & 2 deletions packages/caliper-core/test/worker/rate-control/noRate.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,8 @@ describe('noRate controller implementation', () => {
msgContent = {
label: 'query2',
rateControl: {
type: 'linear-feedback-rate',
opts: { startingTps: 20, finishingTps: 80 }
type: 'dummy',
opts: { }
},
workload: {
module:'./../queryByChannel.js'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ test:
rounds:
- label: init1
txNumber: 100
rateControl: { type: 'fixed-load', opts: { "transactionLoad": 5, "startingTps": 100 }}
rateControl: { type: 'fixed-load', opts: { "transactionLoad": 5, "startTps": 100 }}
workload:
module: ./../init.js
arguments:
Expand Down

0 comments on commit 44b3c52

Please sign in to comment.