NBomber icon indicating copy to clipboard operation
NBomber copied to clipboard

Bump FsToolkit.ErrorHandling.TaskResult version

Open z0h3 opened this issue 2 years ago • 14 comments

Bump version to prevent incompatible assembly using.

Unhandled exception. System.IO.FileNotFoundException: Could not load file or assembly 'Ply, Version=0.3.1.0, Culture=neutral, PublicKeyToken=null'. The system cannot find the file specified.

File name: 'Ply, Version=0.3.1.0, Culture=neutral, PublicKeyToken=null'
   at NBomber.DomainServices.NBomberRunner.runSession(TestInfo testInfo, NodeInfo nodeInfo, NBomberContext context, IGlobalDependency dep)
   at NBomber.DomainServices.NBomberRunner.run(Boolean disposeLogger, NBomberContext context)
   at NBomber.FSharp.NBomberRunner.runWithResult(IEnumerable`1 args, NBomberContext context)
   at NBomber.FSharp.NBomberRunner.run(NBomberContext context)
   at <StartupCode$NBomberTest>.$Program.main@() in /**/NBomberTest/NBomberTest/Program.fs:line 12

Process finished with exit code 134.

Code:

open NBomber.FSharp

let scenario =
    Scenario.create("test", fun ctx -> task { return Response.ok() })
    |> Scenario.withoutWarmUp
    |> Scenario.withLoadSimulations [LoadSimulation.Inject(100, TimeSpan.FromSeconds 1., TimeSpan.FromMinutes 1.)]
    
let result =
    [scenario]
    |> NBomberRunner.registerScenarios
    |> NBomberRunner.run

printfn $"{result}"

fsproj:

<Project Sdk="Microsoft.NET.Sdk">

    <PropertyGroup>
        <OutputType>Exe</OutputType>
        <TargetFramework>net7.0</TargetFramework>
    </PropertyGroup>

    <ItemGroup>
        <Compile Include="Program.fs" />
    </ItemGroup>

    <ItemGroup>
      <PackageReference Include="FsToolkit.ErrorHandling.TaskResult" Version="4.5.0" />
      <PackageReference Include="NBomber" Version="4.1.2" />
    </ItemGroup>

</Project>

z0h3 avatar Apr 10 '23 17:04 z0h3

Hi @z0h3

Do you know if this problem is relevant to your local env?

AntyaDev avatar Apr 11 '23 06:04 AntyaDev

Hi @AntyaDev

I described my problem in slack: https://nbomberworkspace.slack.com/archives/C050LL4LCP3/p1681136967041579 I added details from slack to PR description

z0h3 avatar Apr 11 '23 07:04 z0h3

answered in slack

AntyaDev avatar Apr 11 '23 14:04 AntyaDev

My team is interested in this, too. We're trying to get started with NBomber load testing, but our application depends upon the latest version of FsToolkit.ErrorHandling and is thus incompatible with NBomber.

colinbobolin avatar Aug 11 '23 18:08 colinbobolin

Hi @colinbobolin ,

Did you use the latest NBomber v5, correct?

AntyaDev avatar Aug 16 '23 07:08 AntyaDev

@AntyaDev yes. I've since opted to decouple my work enough to be able to bypass the incompatibility, but with .net 7.0 I still needed to add the FsToolkit.ErrorHandling.TaskResult version 2.13.0 dependency explicitly to a fresh project with no other dependencies.

colinbobolin avatar Aug 16 '23 16:08 colinbobolin

@colinbobolin, what is your company name?

AntyaDev avatar Aug 16 '23 17:08 AntyaDev

@AntyaDev AutoStore. We're trying to assess if this will work for us before purchasing the license, if that's why you're asking.

colinbobolin avatar Aug 16 '23 19:08 colinbobolin

@colinbobolin Thanks for the information. I will take a look at this issue. I recall that to fix this issue, I need to switch NBomber to netstandart 2.1 or something higher than netstandart 2.0 which will cause a drop in support of the legacy .NET Framework.

Not sure what other options do we have?

AntyaDev avatar Aug 16 '23 19:08 AntyaDev

@AntyaDev I see. I think I found a workable solution for now by making a new dotnet sln and referencing FsToolkit.ErrorHandling.TaskResult version 2.13.0 dependency explicitly.

colinbobolin avatar Aug 16 '23 20:08 colinbobolin

@colinbobolin, It should theoretically work, but I am unsure since it has a significant version change. Please let me know if it fixed this issue. I will try to play with other options to fix it.

AntyaDev avatar Aug 16 '23 20:08 AntyaDev

@AntyaDev the only thing that seems to be not working so far is the console logger.

System.Security.VerificationException: Method Spectre.Console.AlignableExtensions.Centered: type argument 'Spectre.Console.Rule' violates the constraint of type parameter 'T'.
   at NBomber.Infra.Console.addHeader(String header)
   at NBomber.DomainServices.Reports.ConsoleReport.ConsoleTestInfo.printTestInfo(TestInfo testInfo)
   at NBomber.DomainServices.Reports.ConsoleReport.print(ILogger logger, NodeSessionResult sessionResult, IDictionary`2 simulations)

colinbobolin avatar Aug 16 '23 20:08 colinbobolin

@colinbobolin can I ask you please to attach your test example to reproduce it? I mean an empty example with the latest FsToolkit.ErrorHandling.TaskResult

AntyaDev avatar Aug 16 '23 20:08 AntyaDev

Hi @colinbobolin , @z0h3 please try this version https://www.nuget.org/packages/NBomber/5.2.1-beta.0

AntyaDev avatar Aug 17 '23 07:08 AntyaDev