[SERVER-35154] Exceptions that escape a ScopedThread should fail the test Created: 22/May/18 Updated: 08/Jan/24 Resolved: 19/Sep/18 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Shell, Testing Infrastructure |
| Affects Version/s: | None |
| Fix Version/s: | 4.1.4 |
| Type: | Improvement | Priority: | Major - P3 |
| Reporter: | Spencer Brody (Inactive) | Assignee: | Max Hirschhorn |
| Resolution: | Fixed | Votes: | 1 |
| Labels: | tig-qwin-eligible | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||||||||||||||||||||||||||
| Backwards Compatibility: | Minor Change | ||||||||||||||||||||||||||||||||||||
| Sprint: | TIG 2018-09-24 | ||||||||||||||||||||||||||||||||||||
| Participants: | |||||||||||||||||||||||||||||||||||||
| Story Points: | 5 | ||||||||||||||||||||||||||||||||||||
| Description |
|
If you start a ScopedThread in a test and it throws an exception, that exception is swallowed and does not error the test, even if the main test thread calls join() and returnData() on the ScopedThread. |
| Comments |
| Comment by Githook User [ 19/Sep/18 ] |
|
Author: {'name': 'Max Hirschhorn', 'email': 'max.hirschhorn@mongodb.com', 'username': 'visemet'}Message: This makes it so that if the ScopedThread exited due to an uncaught |
| Comment by Spencer Brody (Inactive) [ 22/May/18 ] |
|
Yeah, it'd be nice if developers didn't have to remember to check hasFailed() any time they write a test that uses ScopedThread. Looking through our existing tests, the vast majority of the ones that use ScopedThread are not currently checking hasFailed anywhere. |
| Comment by Mira Carey [ 22/May/18 ] |
|
Right now I think the contract for checking thread failure is invoking hasFailed() on the thread (which is what the fsm tests do to check). Now that we have better exception/status convertability, I wouldn't be against making a version of thread (or cutting over hard if that seems advised) which throws on returnData() if the other thread exited with an exception. |