Skip to content

Test Assembly using NUnitLite & Nunit 3.6.1 hangs under .NET Core when --timeout is supplied on command line #2147

Closed
@leasunhy

Description

@leasunhy

Given a program using NuGet packages NUnitLite and NUnit:

using System;
using System.Reflection;
using NUnitLite;
using NUnit.Framework;

namespace NetCoreNUnitLiteTest
{
    public class Program
    {
        public static int Main(string[] args)
        {
            return new AutoRun(Assembly.GetEntryAssembly()).Execute(args);
        }

        [Test]
        public static void T1()
        {
            Console.WriteLine("hello");
        }
    }
}

When a --timeout=1 is supplied on the command line, it hangs after printing out:

NUnitLite 3.6.1 (NetStandard 1.6)
Copyright (C) 2017 Charlie Poole

Runtime Environment
   OS Version: Microsoft Windows 10.0.15063
  CLR Version: .NET Core 4.6.25009.03

Test Files
    c:/users/xxxxx/documents/visual studio 2017/Projects/NetCoreNUnitLiteTest/NetCoreNUnitLiteTest/bin/Debug/netcoreapp1.1/NetCoreNUnitLiteTest.dll

I did some experiment to debug it and realized that it hangs before running the test, not after.

The program runs perfectly under .Net Framework, so I guess this is a bug specially for the netstandard build.

Later I realized that timeout is not supported by a netstandard build, but I wasn't able to find any reason accounting for the hang.

BTW, is there going to be timeout support for .NET Core in upcoming releases of NUnit? :-)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions