question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

benchmark / beforeEverything fails when running in docker-win

See original GitHub issue

I am trying to run a benchmark inside a docker-win container using hyper-v. When I run the benchmark with a default config I see an error like:

BeforeEverythingElse
exitcode != 0

no results were gathered

when I run using the debugInProcess config - the benchmark runs.

I tried the advice here: https://benchmarkdotnet.org/articles/guides/troubleshooting.html#in-the-same-process

but the execution never seems to make it to my benchmark to even enter the while loop.

debugging the resulting genereted.exe using MDbg.exe just seem to hang forever at the BeforeAnythingElse step.

Is there anything that would prevent the benchmarks from running in docker-win?

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:16 (9 by maintainers)

github_iconTop GitHub Comments

3reactions
adamsitnikcommented, Jan 6, 2020

Since BenchmarkDotNet is maintained by MS

It is not. From all the maintainers only I work at MS and I contribute to it in my free time (unless there is a bug|feature blocking my Team). It’s part of the .NET Foundation but in reality, it means that we get a logo and CI for free.

I am sorry but I currently don’t have the time to dig into that.

takes to long to run. Prefer to use out-of-process toolchains for long-running benchmarks

To avoid this problem you can create a custom instance of InProcessToolchain and change the default timeout to a bigger value.

https://benchmarkdotnet.org/api/BenchmarkDotNet.Toolchains.InProcess.NoEmit.InProcessNoEmitToolchain.html#BenchmarkDotNet_Toolchains_InProcess_NoEmit_InProcessNoEmitToolchain__ctor_System_TimeSpan_System_Boolean_

using BenchmarkDotNet.Configs;
using BenchmarkDotNet.Jobs;
using BenchmarkDotNet.Running;
using BenchmarkDotNet.Toolchains.InProcess.NoEmit;
using System;

namespace BenchmarkDotNet.Samples
{
    class Program
    {
        static void Main(string[] args) => BenchmarkSwitcher.FromAssembly(typeof(Program).Assembly)
            .Run(args, DefaultConfig.Instance.With(Job.Default.With(new InProcessNoEmitToolchain(timeout: TimeSpan.FromHours(1), logOutput: false))));
    }
}
3reactions
onedamicommented, Jan 2, 2020

I’m getting this same error while trying to run Bencmarkdotnet on Microsoft Azure DevOps. When I run it using [InProcess], it throws an exception “…takes to long to run. Prefer to use out-of-process toolchains for long-running benchmarks”.

NB: Both InProcess and out of process run successfully on my local PC.

Has anyone gotten around this?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Benchmarks do not execute (as service process / VSTS ...
NET Framework benchmarks are executed from a VSTS agent, running on a non US English Windows installation, the benchmark fails with.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found