diff options
author | Philippe Perrin <philippe.perrin@sonarsource.com> | 2021-10-18 15:08:13 +0200 |
---|---|---|
committer | sonartech <sonartech@sonarsource.com> | 2021-10-18 20:03:25 +0000 |
commit | 7f8a4271ae5b4710466cd1fadb37c267e427c38a (patch) | |
tree | 2e9496277869c9469a1616b5c71edfc77e294471 /build.gradle | |
parent | c522adcea587a403a61800652c81b5993b5289d1 (diff) | |
download | sonarqube-7f8a4271ae5b4710466cd1fadb37c267e427c38a.tar.gz sonarqube-7f8a4271ae5b4710466cd1fadb37c267e427c38a.zip |
Fix flaky parallel yarn install
Diffstat (limited to 'build.gradle')
-rw-r--r-- | build.gradle | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/build.gradle b/build.gradle index 899e6c063fb..c617763888c 100644 --- a/build.gradle +++ b/build.gradle @@ -656,14 +656,10 @@ gradle.projectsEvaluated { gradle -> .findResults { it -> it.tasks.findByName('dependencyCheckAggregate_prerequisites') } .each { t -> dependencyCheckAggregate.dependsOn(t) } - // yarn_run tasks can't all run in parallel without yarn's global cache being populated - // this script add a dependency on all yarn_run tasks to the sonar-web yarn_run task - // this way we are sure that the yarn global cache is available and populated before running the - // rest of the yarn_run tasks in parrallel + // yarn_run tasks can't all run in parallel without random issues + // this script ensure all yarn_run tasks run sequentially def yarnRunTasks = allprojects.findResults { it -> it.tasks.findByName('yarn_run') } - def sonarWebyarnRunTask = yarnRunTasks.find { t -> t.project.name == 'sonar-web' } - yarnRunTasks.remove(sonarWebyarnRunTask) - yarnRunTasks.each { t -> t.mustRunAfter(sonarWebyarnRunTask) } + yarnRunTasks.drop(1).eachWithIndex { it, i -> it.mustRunAfter(yarnRunTasks[0..i]) } } ext.osAdaptiveCommand = { commands -> |