1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-08-12 02:35: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:
Christian Walther 2022-08-18 17:32:31 +02:00 committed by Jonah Graham
parent 5f3cd7ac20
commit ef195dbb73

View file

@ -851,6 +851,10 @@ public class BuiltinSpecsDetectorTest extends BaseTestCase {
assertEquals(true, provider.isExecuted());
assertEquals(ENV_SAMPLE_VALUE_2, provider.getSampleEnvVar());
// clean up
vars.deleteAll();
fUserSupplier.setWorkspaceEnvironment(vars);
// unregister listeners
provider.unregisterListener();
}