nunit / nunit-vs-adapter

Runs NUnit V2 tests inside the Visual Studio 2012 or later Test Explorer window.
MIT License
50 stars 43 forks source link

Timeout on TestFixtureSetup does not seem to work #107

Closed phasemaster closed 8 years ago

phasemaster commented 8 years ago

In the following setup, I expect the TestFixtureSetup to be aborted by a timeout:

    [TestFixture]
    public class TestRun
    {
        [TestFixtureSetUp, Timeout(20000)]
        public void ClassSetUp()
        {
            Console.WriteLine("Starting TestFixtureSetUp");
            for (int i = 1; i <= 120; i++)
            {
                Thread.Sleep(1000);
                Console.WriteLine("{0} seconds", i);
            }
        }

        [Test, Timeout(25000)]
        public void TheTest()
        {
            Console.WriteLine("Starting Test");
        }
    }

It is not. Why?

CharliePoole commented 8 years ago

Timeout on a test fixture sets the default timeout for each method. There is no timeout setting for fixtures. Per https://github.com/nunit/docs/wiki/Timeout-Attribute...

"The attribute may also be specified on a fixture or assembly, in which case it indicates the default timeout for any subordinate test cases."