PragmaticFlow / NBomber

Modern and flexible load testing framework for Pull and Push scenarios, designed to test any system regardless a protocol (HTTP/WebSockets/AMQP etc) or a semantic model (Pull/Push).
https://nbomber.com
Other
2.07k stars 131 forks source link

Backwards compatibility issues with NATS Client #687

Closed tpelabon closed 3 months ago

tpelabon commented 4 months ago

We uses NATS.Client in our code but nBomber is using an older version which creates conflicts for us, and we cannot downgrade as we need feature used in 1.1.2.

Our workaround is for us to remove our usage of NATS immediately. But this is only a temporary solution because we will have it soon as a hard requirement. We are using NATS JetStream, which is not available in the outdated NATS client NBomber is referencing to. And Upgrade should be harmless. Our problem is that NATS client changed their connection interface and thus the library is breaking now. I would suggest

  1. Updating NATS client to > 1.1.0
  2. Pin the version within the minor so only >1.1.0 and < 1.2.0 is allowed. This gives clear compile errors rather than the runtime errors we see. NATS seems to break backwards compatibility within minor versions.
/ # nats-server --version
nats-server: v2.10.7 (edited) 

But the issue is not the NATS server version, its that the client broke backwards compatibility but its not detected proper (because NBomber does not define a < version requirement). I have to say, its shitty from NATS to break it, because I would assume backwards compatiblity between minor versions

AntyaDev commented 3 months ago

Hi @tpelabon ,

Please try NBomber 5.7.0-beta.4

tpelabon commented 3 months ago

Hello @AntyaDev, thanks for the update! I updated my NBomber to the 5.7.0-beta.4 but sadly I still have the method not found error :

"Unhandled exception. System.MissingMethodException: Method not found: 'NATS.Client.IConnection NATS.Client.ConnectionFactory.CreateConnection(NATS.Client.Options)`.
   at NBomber.Infra.Nats.connect@13-1.MoveNext()
   at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[TStateMachine](TStateMachine& stateMachine)
   at NBomber.Infra.Nats.connect@13.Invoke(Unit unitVar0)
   at NBomber.Infra.Operation.retryForever@9.MoveNext()
   at NBomber.DomainServices.Runners.AutoClusterRunner.run@36-4.MoveNext()
   at NBomber.DomainServices.NBomberRunner.task@51.MoveNext()
   at NBomber.DomainServices.NBomberRunner.run(Boolean disposeLogger, NBomberContext context)
   at NBomber.FSharp.NBomberRunner.runWithResult(IEnumerable1 args, NBomberContext context)
   at NBomber.FSharp.NBomberRunner.run(NBomberContext context)
   at NBomber.CSharp.NBomberRunner.Run(NBomberContext context)
   at Klang.Seed.CCUTestWorker.Program.Main(String[] args) in C:\Users\Thibault\seed\tools\ccu-test\ccu-testworker\Program.cs:line 134"

Any idea what is wrong ?

AntyaDev commented 3 months ago

Hi @tpelabon , What version of NATS did you install?

tpelabon commented 3 months ago

@AntyaDev our NATS.Client is at 1.1.2

AntyaDev commented 3 months ago

@tpelabon Please try 5.7.0-beta.5 Now NBomber contains

<PackageReference Include="NATS.Client" Version="[1.1.5]" />
tpelabon commented 3 months ago

@AntyaDev It works with 5.7.0-beta.5 ! Thanks for the fix 🙌