dcf7b84082
- Shared application environments can be disposed in the middle of test plan execution when the project count reaches zero. So resetting `ApplicationManager` only on "test plan execution finished" is incorrect, because it does not account for that scenario. Instead, we should reset `ApplicationManager` every time the application environment is disposed. - We should also keep the manual reset in `testPlanExecutionFinished` because `disposeApplicationEnvironment` may not need to dispose anything if there isn't a shared application environment, but we should still reset `ApplicationManager` if an unshared application environment was created. - This fixes "Some test disposed, but forgot to clear MockApplication" exceptions which appeared after KT-64099 because it opened up proper disposal of the shared application environment (instead of it being in a state of leakage because not all project disposables were properly disposed). ^KT-63650 ^KT-64099