Timed out datarow affects subsequent datarows
See original GitHub issueDescription
When executing a test with multiple datarows, and one datarow times out, all subsequent datarows are aborted and marked failed.
Steps to reproduce
Runt the following test:
[TestClass]
public class UnitTest1
{
[DataTestMethod]
[DataRow(1)]
[DataRow(2)]
[DataRow(3)]
[DataRow(2000)]
[DataRow(4)]
[DataRow(5)]
[Timeout(500)]
public async Task TestDataRowTimeout(int delay)
{
await Task.Delay(delay);
}
}
Expected behavior
Only datarow with value 2000
times out. However row 4 and 5 are aborted with message Test 'TestDataRowTimeout' execution has been aborted.
The timeout doesn’t apply to the combined time for all rows - that can be confirmed by setting the first few rows to be very close to 500, and added up exeeding the timeout value. If the combined time spent mattered, it would time out before making it to the slow row.
Actual behavior
all rows after the timed out row are aborted.
Environment
VS2019.7. .NET Core 3.1. using latest packages.
.csproj
used:
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
<IsPackable>false</IsPackable>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.7.0" />
<PackageReference Include="MSTest.TestAdapter" Version="2.1.2" />
<PackageReference Include="MSTest.TestFramework" Version="2.1.2" />
</ItemGroup>
</Project>
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:11 (11 by maintainers)
Top Results From Across the Web
c# - SetAdded and SetModified can only be called on ...
By doing some research, I am able to find out the answer myself. The row state of DataTable can be changed to Unchanged...
Read more >Updating Data Sources with DataAdapters - ADO.NET
Calling AcceptChanges on the DataSet , DataTable , or DataRow will cause all Original values for a DataRow to be overwritten with the...
Read more >Dumb Schedules - parameter conflict and insert data row ...
I made some schedules that did allow the addition of rows to be inserted above or below, but now the option to insert...
Read more >SSRS 2012: Errmsg 'Cannot read the next data row for ...
Hi All In SSRS 2012 I have a report that returns the error message in the question title when ran on our SSRS...
Read more >What is the limit of records we can deal with?
If you have too many rows to get good performance, then the first things to try are using Deferred Rendering (so only the...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@dotMorten, this should be fixed with out latest release. Please use
16.10.0
version ofMicrosoft.NET.Test.Sdk
and the latest preview ofMSTest
; and let us know if you still have this problem.@dotMorten
There are multiple things mixed together.
MSTest (until the update you are testing), reported each testcase in the same test. The timeout applies to the test, that is to all testcases combined. If all testcases together take more time than the timeout, the timeout will be triggered.
With the update each test case is reported as a single test, and will get its own timeout.
BUT still, if any test times out, the timing out should trigger killing the process, which used to happen, but it seems to not happen anymore. Instead we complete a task that reports error, but the task that is running the test code still continues. It behaves the same way that NUnit is behaving. But now after the update the next test gets the chance to run, even though the timed out test is still running in the background.
Output:
Pre update:
After update: