-
Notifications
You must be signed in to change notification settings - Fork 4.6k
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
Microsoft.Win32.Registry.Tests fail when run build.cmd #14031
Comments
@pallavit, is it known issue? On the first glance it looks like a product bug or some concurrency problem. @cnblogs-dudu, does it repro all the time? |
@krwq |
Object obj = _rk1.GetValue(null, null, RegistryValueOptions.DoNotExpandEnvironmentNames);
if (obj != null)
{
Assert.False(true, "Error Key value is incorrect...");
} obj value is 0. |
@cnblogs-dudu, if you open regedit and click on HKEY_CURRENT_USER, in the right pane you should see an entry for "(DEFAULT)". For that row, under the Data column, do you see "(value not set)" or do you see something else, like "0"? I ask because the four tests you're seeing fail are verifying that no default value is set for HKEY_CURRENT_USER. Doesn't seem like a valid assumption for the test to be making, but nevertheless... |
@stephentoub |
@stephentoub |
Thanks, @cnblogs-dudu. And yeah, this is why I said "Doesn't seem like a valid assumption for the test to be making"... something else on your machine seems to be setting that value to 0, which is then causing a subsequent execution of the tests to fail. The tests should really be fixed to not assume that HKEY_CURRENT_USER's (Default) value is unspecified. |
Original tests rely on assumption that default value is not set for HKEY_CURRENT_USER. This assumption is wrong because default value of HKEY_CURRENT_USER could be used by someone else which will cause tests failure. This commit fixes tests to rely on default value of test subkey. Fixes #566
Original tests rely on assumption that default value is not set for HKEY_CURRENT_USER. This assumption is wrong because default value of HKEY_CURRENT_USER could be used by someone else. Also original tests rely on assumption that value with name "tt" doesn't exists in HKEY_CURRENT_USER which also could be wrong on some machines. In general tests should be run against test subkey instead of HKEY_CURRENT_USER. This commit fixes this. Fixes #566
Error log:
The text was updated successfully, but these errors were encountered: