Skip to content
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

Fix failing BerConverterTests.Decode_TestData test #99793

Merged
merged 3 commits into from
Mar 18, 2024

Conversation

edwardneal
Copy link
Contributor

Resolves #99725 and allows the Decode_TestData test to run under CI again. Also replaces #99773.

There's different behaviour between Windows 7 and later versions - the V and v format specifiers in ber_scanf return a two-element array for the test data in Windows 7, and a three-element array in later versions. I've adjusted the test to account for times when it runs on Windows 7.

I'll leave the PR on draft so that the build can run and confirm the test's now working properly in both scenarios prior to merge.

Copy link
Contributor

Tagging subscribers to this area: @dotnet/area-system-directoryservices, @jay98014
See info in area-owners.md if you want to be subscribed.

@dotnet-policy-service dotnet-policy-service bot added the community-contribution Indicates that the PR has been added by a community member label Mar 14, 2024
@stephentoub
Copy link
Member

This will also need to re-enable the test.

[ActiveIssue("https://github.com/dotnet/runtime/issues/99725")]

…haviour between Windows 7 and later versions.

This is intended to fix the Decode_Bytes_ReturnsExpected test.
Results are inconsistent: Windows 7 maintained its previous behaviour, but Windows 8.1 and Nano Server behaved differently, failing with the same inputs.
It seems like we're hitting undefined behaviour in Windows' underlying ber_scanf, when processing two consecutive zero-length octet strings with the "v" and "V" specifiers. This isn't the point of the test though - changed the test inputs to supply well-formed BER data so that we can move on to actually testing the format specifier.
@edwardneal
Copy link
Contributor Author

Thanks. My changes predate the test disablement by a few minutes, so didn't have it. I've rebased my branch, and once my local test run and CI have both run and passed the tests, I'll pull the PR out of draft.

@edwardneal
Copy link
Contributor Author

The test passed on local test run and CI - the PR's build failure is due to a regex test crashing. I've opened the PR up for review/merge.

cc @vcsjones

@steveharter steveharter merged commit 1d2b1ae into dotnet:main Mar 18, 2024
109 of 111 checks passed
@edwardneal edwardneal deleted the issue-99725 branch March 18, 2024 22:22
@github-actions github-actions bot locked and limited conversation to collaborators Apr 18, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-System.DirectoryServices community-contribution Indicates that the PR has been added by a community member
Projects
None yet
Development

Successfully merging this pull request may close these issues.

System.DirectoryServices.Protocols.Tests.BerConverterTests.Decode_Bytes_ReturnsExpected failing on Windows x86
3 participants