Timeout test fails under Mono on Linux

Bug #641423 reported by Charlie Poole
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
NUnit V2
Fix Released
Medium
Charlie Poole

Bug Description

The test NUnit.Core.Tests.ThreadingTests.TimeoutCanBeSetOnTestFixture fails under Mono on Linux. The individual test should return a Failure result but returns Cancelled. It works correctly on Windows.

Related branches

Changed in nunitv2:
status: New → Confirmed
importance: Undecided → Medium
status: Confirmed → In Progress
assignee: nobody → Charlie Poole (charlie.poole)
Revision history for this message
Charlie Poole (charlie.poole) wrote :

This bug uncovers a race condition in the TestThread class. Both the original thread and the test thread update the TestResult that is passed into TestThread. Under Windows, the originating thread was always the last thread to update it, which is the desired behavior. But under Linux, the test thread is making the last update, leading to an incorrect result.

Locking won't help here, since the updates would eventually be made when the lock is released.

The correct solution is for the test thread to use an entirely separate result, which is read but not written by the original thread.

Changed in nunitv2:
status: In Progress → Fix Committed
milestone: none → 2.5.8
Changed in nunitv2:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.