-
Notifications
You must be signed in to change notification settings - Fork 31
Description
Context: PR #90
Context: https://dev.azure.com/xamarin/public/_build/results?buildId=21603&view=logs&j=2d2b3007-3c5c-5840-9bb0-2b1ea49925f3
The "unrelated test failure" on Windows is because Windows is non-deterministic: the test asserts that given an Android SDK directory androidSdk which contains the file {androidSdk}\ndk-bundle\ndk-stack.cmd, then this:
var info = new AndroidSdkInfo (logger: null, androidSdkPath: androidSdk);will return {androidSdk}\ndk-bundle as the info.AndroidNdkPath value.
The problem is that the info.AndroidNdkPath logic involves is doomed to fail. For starters, if the Registry has an NDK path configured, it is preferred:
If the Registry doesn't have a preferred NDK value, then we hit AndroidSdkWindows.GetAllAvailableAndroidNdks(), which involves a .Distinct() call:
which means that the order of returned directories is unknowable and may (will?) vary from test run to test run.
This is, in short, a highly "unstable" algorithm which won't be consistent from one run to the next. Which explains why it sometimes fails, and sometimes doesn't. :-(