Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix some flaky managedbuilder tests #54

Merged
merged 2 commits into from Aug 22, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -851,6 +851,10 @@ public void testAbstractBuiltinSpecsDetector_EnvChangesGlobal() throws Exception
assertEquals(true, provider.isExecuted());
assertEquals(ENV_SAMPLE_VALUE_2, provider.getSampleEnvVar());

// clean up
vars.deleteAll();
fUserSupplier.setWorkspaceEnvironment(vars);

// unregister listeners
provider.unregisterListener();
}
Expand Down
Expand Up @@ -202,14 +202,20 @@ public void testPersistentProperties() throws Exception {
coreModel.setProjectDescription(project, des);
Assert.assertEquals(project, des.getProject());

Thread.sleep(1000); // let scanner discovery participate
try {
QualifiedName pdomName = new QualifiedName(CCorePlugin.PLUGIN_ID, "pdomName");
QualifiedName activeCfg = new QualifiedName(CCorePlugin.PLUGIN_ID, "activeConfiguration");
QualifiedName settingCfg = new QualifiedName(CCorePlugin.PLUGIN_ID, "settingConfiguration");
QualifiedName discoveredScannerConfigFileName = new QualifiedName(MakeCorePlugin.PLUGIN_ID,
"discoveredScannerConfigFileName");

// pdomName is set by indexer setup, which may still be postponed or not even
// scheduled yet, so we can't join the job. Just wait for the property to appear.
// (The other properties were set synchronously in setProjectDescription().)
for (int i = 0; i < 100 && !project.getPersistentProperties().containsKey(pdomName); i++) {
Thread.sleep(100);
}

assertTrue("pdomName", project.getPersistentProperties().containsKey(pdomName));
assertTrue("activeCfg", project.getPersistentProperties().containsKey(activeCfg));
assertTrue("discoveredScannerConfigFileName",
Expand Down