-
Notifications
You must be signed in to change notification settings - Fork 4.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
System.Diagnostics.Tests.InstanceDataTests.InstanceDataCollectionCollection_CopyTo failing in CI #68291
Comments
I couldn't figure out the best area label to add to this issue. If you have write-permissions please help me learn by adding exactly one area label. |
Tagging subscribers to this area: @dotnet/area-system-diagnostics-performancecounter Issue DetailsConfiguration: Build: https://dev.azure.com/dnceng/public/_build/results?buildId=1721549
|
we already have retries here, but evidently those were successful or not needed as there would have been an exception. So [Fact]
public static void InstanceDataCollectionCollection_CopyTo()
{
InstanceDataCollectionCollection idcc = GetInstanceDataCollectionCollection();
InstanceDataCollection[] idc = new InstanceDataCollection[idcc.Values.Count];
idcc.CopyTo(idc, 0);
Assert.True(idc.Length > 0);
}
public static InstanceDataCollectionCollection GetInstanceDataCollectionCollection()
{
PerformanceCounterCategory pcc = Helpers.RetryOnAllPlatforms(() => new PerformanceCounterCategory("Processor"));
return Helpers.RetryOnAllPlatforms(() => pcc.ReadCategory());
} we should update to retry if there were 0 values. basically add an optional |
#60933 is similar: retries needed on the ctor in those cases. |
@danmoseley Since return Helpers.RetryOnAllPlatforms(() =>
{
var idcc = pcc.ReadCategory();
if (idcc.Values.Count == 0)
{
throw new ZeroDataException;
}
return idcc;
}); In that case, passing a Edit: I put up a PR with this approach. Please let me know if there's I'm missing here. |
Previously, when pcc.ReadCategory() returned 0 values, we did not retry, which broke the test that asserted its length > 0. This time, we retry when there are 0 values, by triggering the RetryHelper's exception handler. Fixes dotnet#68291
@smasher164 sounds reasonable. |
…70119) * fix InstanceDataCollectionCollection_CopyTo by retrying on 0 values Previously, when pcc.ReadCategory() returned 0 values, we did not retry, which broke the test that asserted its length > 0. This time, we retry when there are 0 values, by triggering the RetryHelper's exception handler. Fixes #68291 * add ZeroDataException * Revert "add ZeroDataException" This reverts commit 43ba3ad. * throw xUnitException instead of making a custom one * no need for if statement
Configuration:
net7.0-windows-Release-x86-CoreCLR_release-Windows.10.Amd64.Server2022.ES.Open
Build: https://dev.azure.com/dnceng/public/_build/results?buildId=1721549
Runfo Tracking Issue: system.diagnostics.tests.instancedatatests.instancedatacollectioncollection_copyto
Build Result Summary
The text was updated successfully, but these errors were encountered: