diff options
author | Hung Nguyen <hungnv@google.com> | 2021-02-05 16:39:16 +0000 |
---|---|---|
committer | Hung Nguyen <hungnv@google.com> | 2021-02-05 20:32:45 +0000 |
commit | 671bd2ffb1d3209632c4817dd8e97ce9ac0cdb6a (patch) | |
tree | 404f547f24854bdc92f60a7e7f394df4a598d0e6 | |
parent | a2da12bea06249dcb769d13bb9ae09c804a85f2b (diff) | |
download | data-binding-671bd2ffb1d3209632c4817dd8e97ce9ac0cdb6a.tar.gz |
Set --max-workers=1 to reduce DB tests' flakiness on Windows
Limit the number of Gradle workers to reduce the chance that the Gradle
build process hangs.
We do this on Windows only as the tests do not flake as frequently on
other OS's.
Also, we will be collecting the thread dump (Issue 179482828), so that
the next time the tests hang, we will have some data to analyze.
Bug: 177936851
Test: Existing tests
Change-Id: Ic75c6797efea25243fb98db148920eda7aa17d3f
-rw-r--r-- | compilationTests/src/test/java/androidx/databinding/compilationTest/DataBindingCompilationTestCase.kt | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/compilationTests/src/test/java/androidx/databinding/compilationTest/DataBindingCompilationTestCase.kt b/compilationTests/src/test/java/androidx/databinding/compilationTest/DataBindingCompilationTestCase.kt index 97a4fc72..d22b5308 100644 --- a/compilationTests/src/test/java/androidx/databinding/compilationTest/DataBindingCompilationTestCase.kt +++ b/compilationTests/src/test/java/androidx/databinding/compilationTest/DataBindingCompilationTestCase.kt @@ -17,6 +17,7 @@ package androidx.databinding.compilationTest import android.databinding.tool.processing.ScopedErrorReport import android.databinding.tool.store.Location +import com.android.SdkConstants import com.android.testutils.TestUtils import com.android.tools.analytics.Environment import com.android.tools.analytics.EnvironmentFakes @@ -127,7 +128,15 @@ abstract class DataBindingCompilationTestCase : AndroidGradleTestCase() { } } } - request.setCommandLineArguments(listOf("--offline") + args) + request.setCommandLineArguments( + listOfNotNull( + "--offline", + // Limit the number of workers to reduce the tests' flakiness on Windows. + // TODO(177936851): Remove this workaround when that bug is fixed. + "--max-workers=1".takeIf { + SdkConstants.currentPlatform() == SdkConstants.PLATFORM_WINDOWS + } + ) + args) val result = invokeGradle(project) { gradleInvoker -> gradleInvoker.executeTasks(request) } |