Skip to content

Commit 9be9090

Browse files
committed
Add a paramter to specify testTimeout in FTL controller.
1 parent 178298f commit 9be9090

File tree

4 files changed

+17
-9
lines changed

4 files changed

+17
-9
lines changed

AndroidXCI/lib/src/main/kotlin/dev/androidx/ci/testRunner/FirebaseTestLabController.kt

+4-2
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,8 @@ internal class FirebaseTestLabController(
111111
pullScreenshots: Boolean = false,
112112
cachedTestMatrixFilter: CachedTestMatrixFilter,
113113
testTargets: List<String>? = null,
114-
flakyTestAttempts: Int = 2
114+
flakyTestAttempts: Int = 2,
115+
testTimeout: String = "2700s"
115116
): List<TestMatrix> {
116117
val devices = (devicePicker ?: defaultDevicePicker).pickDevices()
117118
logger.info {
@@ -129,7 +130,8 @@ internal class FirebaseTestLabController(
129130
pullScreenshots = pullScreenshots,
130131
cachedTestMatrixFilter = cachedTestMatrixFilter,
131132
testTargets = testTargets,
132-
flakyTestAttempts = flakyTestAttempts
133+
flakyTestAttempts = flakyTestAttempts,
134+
testTimeout = testTimeout
133135
)
134136
}
135137
}

AndroidXCI/lib/src/main/kotlin/dev/androidx/ci/testRunner/TestMatrixStore.kt

+7-4
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,8 @@ internal class TestMatrixStore(
7171
pullScreenshots: Boolean = false,
7272
cachedTestMatrixFilter: CachedTestMatrixFilter = { true },
7373
testTargets: List<String>? = null,
74-
flakyTestAttempts: Int = 2
74+
flakyTestAttempts: Int = 2,
75+
testTimeout: String = "2700s"
7576
): TestMatrix {
7677

7778
val testRunId = TestRun.createId(
@@ -101,7 +102,8 @@ internal class TestMatrixStore(
101102
testApk = testApk,
102103
pullScreenshots = pullScreenshots,
103104
testTargets = testTargets,
104-
flakyTestAttempts = flakyTestAttempts
105+
flakyTestAttempts = flakyTestAttempts,
106+
testTimeout = testTimeout
105107
)
106108
logger.info {
107109
"created test matrix: $newTestMatrix"
@@ -260,7 +262,8 @@ internal class TestMatrixStore(
260262
testApk: UploadedApk,
261263
pullScreenshots: Boolean = false,
262264
testTargets: List<String>? = null,
263-
flakyTestAttempts: Int = 2
265+
flakyTestAttempts: Int = 2,
266+
testTimeout: String = "2700s"
264267
): TestMatrix {
265268
val packageName = firebaseTestLabApi.getApkDetails(
266269
FileReference(
@@ -288,7 +291,7 @@ internal class TestMatrixStore(
288291
)
289292
}
290293
val testSpecification = TestSpecification(
291-
testTimeout = "2700s", // Limit for physical devices.
294+
testTimeout = testTimeout,
292295
disableVideoRecording = false,
293296
disablePerformanceMetrics = true, // Not a useful feature for androidx
294297
androidInstrumentationTest = AndroidInstrumentationTest(

AndroidXCI/lib/src/main/kotlin/dev/androidx/ci/testRunner/TestRunnerService.kt

+2-1
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,8 @@ interface TestRunnerService {
8282
pullScreenshots: Boolean = false,
8383
cachedTestMatrixFilter: CachedTestMatrixFilter = { true },
8484
testTargets: List<String>? = null,
85-
flakyTestAttempts: Int = 2
85+
flakyTestAttempts: Int = 2,
86+
testTimeout: String = "2700s"
8687
): ScheduleTestsResponse
8788

8889
/**

AndroidXCI/lib/src/main/kotlin/dev/androidx/ci/testRunner/TestRunnerServiceImpl.kt

+4-2
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,8 @@ internal class TestRunnerServiceImpl internal constructor(
102102
pullScreenshots: Boolean,
103103
cachedTestMatrixFilter: CachedTestMatrixFilter,
104104
testTargets: List<String>?,
105-
flakyTestAttempts: Int
105+
flakyTestAttempts: Int,
106+
testTimeout: String
106107
): TestRunnerService.ScheduleTestsResponse {
107108
val testMatrices = testLabController.submitTests(
108109
appApk = appApk ?: apkStore.getPlaceholderApk(),
@@ -114,7 +115,8 @@ internal class TestRunnerServiceImpl internal constructor(
114115
pullScreenshots = pullScreenshots,
115116
cachedTestMatrixFilter = cachedTestMatrixFilter,
116117
testTargets = testTargets,
117-
flakyTestAttempts = flakyTestAttempts
118+
flakyTestAttempts = flakyTestAttempts,
119+
testTimeout = testTimeout
118120
)
119121
return TestRunnerService.ScheduleTestsResponse.create(
120122
testMatrices

0 commit comments

Comments
 (0)