Skip to content

Commit

Permalink
fixed bug with invalid handling for RampingConstant load simulations
Browse files Browse the repository at this point in the history
  • Loading branch information
AntyaDev committed Dec 28, 2022
1 parent fe71f60 commit 238a899
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/NBomber/Domain/LoadSimulation.fs
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ let create (simulations: Contracts.LoadSimulation list) =

let inline getSimulationInterval simulation =
match simulation with
| RampingConstant (copies, during) -> during
| RampingConstant (copies, during) -> Constants.DefaultSchedulerTickInterval
| KeepConstant (copies, during) -> during
| RampingInject (_, interval, during) -> interval
| Inject (rate, interval, during) -> interval
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,3 +98,27 @@ let ``Stop should stop all working actors`` () =
test <@ scheduler.ScheduledActorCount = 5 @>
test <@ Seq.length workingActors = 0 @>
test <@ scheduler.AvailableActors.Count = 5 @>

[<Fact>]
let ``RampingConstant should work correctly`` () =

Scenario.create("scenario", fun ctx -> task {

let! step = Step.run("step", ctx, fun () -> task {
do! Task.Delay(milliseconds 100)
return Response.ok()
})

return Response.ok()
})
|> Scenario.withoutWarmUp
|> Scenario.withLoadSimulations [RampingConstant(copies = 10, during = seconds 5)]
|> NBomberRunner.registerScenario
|> NBomberRunner.withoutReports
|> NBomberRunner.run
|> Result.getOk
|> fun nodeStats ->
let stats = nodeStats.ScenarioStats[0]

test <@ stats.AllRequestCount > 0 @>
test <@ stats.Ok.Request.Count > 0 @>

0 comments on commit 238a899

Please sign in to comment.