Closed jamesweakley closed 6 years ago
@jamesweakley, Hi James, thank you for having a look at this. Please tell me what you mean by this will fail a test case...?
Does this mean that "checkObserver" cannot be used in conjunction with your solution?
@cogmission Hi David,
Because the errors shown on this issue never actually resulted in a test case failure, I wanted to make them break a test before addressing the root cause. I made the assumption that you'd want observers to have visibility of any unhandled exceptions in a Layer thread, even in production.
So there are two files changed in my solution: 1) The change in Layer.java causes the test "testStoreAndLoad_FileSensor" in PersistenceAPITest to fail when run under the Australia/Sydney timezone (and perhaps others). This is because when the test case calls checkObserver at the end, it will now have visibility of the exceptions that occurred in the Layer thread. 2) The change in PersistenceAPITest forces the tests to run with UTC as the local timezone, which means that the failure created above goes back to passing again.
Hope this makes sense!
@jamesweakley Hi James,
Awesome explanation. Now I understand. Thanks! Merging...
Notify observers of uncaught exceptions in layer thread, this will fail a test case when checkObserver is being called. In the affected test case, force UTC timezone for a more consistent test experience.