Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump FsToolkit.ErrorHandling.TaskResult version #576

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from

Conversation

z0h3
Copy link

@z0h3 z0h3 commented Apr 10, 2023

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>

@AntyaDev
Copy link
Contributor

AntyaDev commented Apr 11, 2023

Hi @z0h3

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

@z0h3
Copy link
Author

z0h3 commented Apr 11, 2023

Hi @AntyaDev

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

@AntyaDev
Copy link
Contributor

answered in slack

@colinbobolin
Copy link

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.

@AntyaDev
Copy link
Contributor

Hi @colinbobolin ,

Did you use the latest NBomber v5, correct?

@colinbobolin
Copy link

colinbobolin commented Aug 16, 2023

@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.

@AntyaDev
Copy link
Contributor

@colinbobolin, what is your company name?

@colinbobolin
Copy link

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

@AntyaDev
Copy link
Contributor

@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?

@colinbobolin
Copy link

@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.

@AntyaDev
Copy link
Contributor

@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.

@colinbobolin
Copy link

colinbobolin commented Aug 16, 2023

@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)

@AntyaDev
Copy link
Contributor

@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
Copy link
Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants