mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-08-12 10:45:37 +02:00
Fix flaky tests in BuiltinSpecsDetectorTest
testAbstractBuiltinSpecsDetector_EnvChangesGlobal did not properly clean up after itself, which caused testAbstractBuiltinSpecsDetector_EnvChangesConfiguration_1, testAbstractBuiltinSpecsDetector_EnvChangesConfiguration_2, and testAbstractBuiltinSpecsDetector_EnvChangesGlobal to fail when run for the second time in the same session. Running tests twice is not useful, but happens in Eclipse with a launch configuration set to run all tests in org.eclipse.cdt.managedbuilder.core.tests/tests - once directly and once through AllLanguageSettingsProvidersMBSTestSuite. I have not found any way of running every test exactly once in the GUI.
This commit is contained in:
parent
5f3cd7ac20
commit
ef195dbb73
1 changed files with 4 additions and 0 deletions
|
@ -851,6 +851,10 @@ public class BuiltinSpecsDetectorTest extends BaseTestCase {
|
||||||
assertEquals(true, provider.isExecuted());
|
assertEquals(true, provider.isExecuted());
|
||||||
assertEquals(ENV_SAMPLE_VALUE_2, provider.getSampleEnvVar());
|
assertEquals(ENV_SAMPLE_VALUE_2, provider.getSampleEnvVar());
|
||||||
|
|
||||||
|
// clean up
|
||||||
|
vars.deleteAll();
|
||||||
|
fUserSupplier.setWorkspaceEnvironment(vars);
|
||||||
|
|
||||||
// unregister listeners
|
// unregister listeners
|
||||||
provider.unregisterListener();
|
provider.unregisterListener();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue