For some reason this happens with the watchOS 4.2 simulator on our
Jenkins bots (but not locally for me).
The test is updated to ignore errors as depending on the sim default
content does not seems possible.
In 0442cdf9c0 the `now` variable was changed to
be a UTC date, but unfortunately the code that compares it to a local date
(NSDate.Now) wasn't updated.
Only year/month/day values were compared, which meant the test would fail if
run when UTC and local time didn't represent the same date (and conversely
would pass if the UTC and local date was the same date, which is why the
changed did not fail the PR test run: the PR was tested during the 19 hours of
the day when EST and UTC represent the sam date).
Fix this by converting the UTC `now` to NSDate instead of using NSDate.Now.
This has the additional benefit of also fixing a (much smaller) race
condition: if midnight occurred just between calculating `now` and NSDate.Now,
the test would also fail.
monotouch-test has a wildcard to automatically include new test files, but
this should not include generated files, because:
* The generated files are generated when needed, which means we can't rely on
the wildcard to trigger their generation, because the wildcard won't find
them before they exist, and as such msbuild won't detect that they're
needed.
* This means the generated files must be listed separately, but in that case
they shouldn't be found by the wildcard too, because that leads to:
/Library/Frameworks/Mono.framework/Versions/5.4.0/lib/mono/msbuild/15.0/bin/Roslyn/Microsoft.CSharp.Core.targets(84,5): error MSB3105: The item "ObjCRuntime/TrampolineTest.generated.cs" was specified more than once in the "Sources" parameter. Duplicate items are not supported by the "Sources" parameter.
So move the generated files to a different directory, so that the wildcard
doesn't find them.
At 2:00 AM on November 5h 2017, winter came to our bots in Boston.
This meant that between 2:00 and 3:00 AM, subtracting 1h from the current
time yielded a time difference of 2h.
This was caught by our observant tests:
[FAIL] CalendarTest.DateComponentsTest : b hour
Expected: 1
But was: 2
To avoid such issues next time this test happens to run during this single
hour of the entire year that causes problems, change the test to use time
calculcation using UTC instead.
This test fails on the bots:
[FAIL] MDLVoxelArrayTest.BoundingBoxTest : MaxX (M)
Expected: -1.0f
But was: 0.0f
For some unknown reason I'm not able to reproduce locally, but the actual
values look normal, so update the test to accept those as well.
* The original API was incorrect. Lack of documentation at binding time?
* Use a strong dictionary to expose the credentials
The fixed version cannot be unit tested since it popups an UI.
The test case attached to the bug report [1] can be used to verify it.
reference:
[1] https://bugzilla.xamarin.com/show_bug.cgi?id=60423