diff --git a/AndroidXCI/lib/src/main/kotlin/dev/androidx/ci/testRunner/FirebaseTestLabController.kt b/AndroidXCI/lib/src/main/kotlin/dev/androidx/ci/testRunner/FirebaseTestLabController.kt index 37ee7c2..f96aa41 100644 --- a/AndroidXCI/lib/src/main/kotlin/dev/androidx/ci/testRunner/FirebaseTestLabController.kt +++ b/AndroidXCI/lib/src/main/kotlin/dev/androidx/ci/testRunner/FirebaseTestLabController.kt @@ -111,7 +111,8 @@ internal class FirebaseTestLabController( pullScreenshots: Boolean = false, cachedTestMatrixFilter: CachedTestMatrixFilter, testTargets: List? = null, - flakyTestAttempts: Int = 2 + flakyTestAttempts: Int = 2, + testTimeoutSeconds: Int = 2700 ): List { val devices = (devicePicker ?: defaultDevicePicker).pickDevices() logger.info { @@ -129,7 +130,8 @@ internal class FirebaseTestLabController( pullScreenshots = pullScreenshots, cachedTestMatrixFilter = cachedTestMatrixFilter, testTargets = testTargets, - flakyTestAttempts = flakyTestAttempts + flakyTestAttempts = flakyTestAttempts, + testTimeoutSeconds = testTimeoutSeconds ) } } diff --git a/AndroidXCI/lib/src/main/kotlin/dev/androidx/ci/testRunner/TestMatrixStore.kt b/AndroidXCI/lib/src/main/kotlin/dev/androidx/ci/testRunner/TestMatrixStore.kt index a7c1221..d357e91 100644 --- a/AndroidXCI/lib/src/main/kotlin/dev/androidx/ci/testRunner/TestMatrixStore.kt +++ b/AndroidXCI/lib/src/main/kotlin/dev/androidx/ci/testRunner/TestMatrixStore.kt @@ -71,7 +71,8 @@ internal class TestMatrixStore( pullScreenshots: Boolean = false, cachedTestMatrixFilter: CachedTestMatrixFilter = { true }, testTargets: List? = null, - flakyTestAttempts: Int = 2 + flakyTestAttempts: Int = 2, + testTimeoutSeconds: Int = 2700 ): TestMatrix { val testRunId = TestRun.createId( @@ -101,7 +102,8 @@ internal class TestMatrixStore( testApk = testApk, pullScreenshots = pullScreenshots, testTargets = testTargets, - flakyTestAttempts = flakyTestAttempts + flakyTestAttempts = flakyTestAttempts, + testTimeoutSeconds = testTimeoutSeconds ) logger.info { "created test matrix: $newTestMatrix" @@ -260,7 +262,8 @@ internal class TestMatrixStore( testApk: UploadedApk, pullScreenshots: Boolean = false, testTargets: List? = null, - flakyTestAttempts: Int = 2 + flakyTestAttempts: Int = 2, + testTimeoutSeconds: Int = 2700 ): TestMatrix { val packageName = firebaseTestLabApi.getApkDetails( FileReference( @@ -288,7 +291,7 @@ internal class TestMatrixStore( ) } val testSpecification = TestSpecification( - testTimeout = "2700s", // Limit for physical devices. + testTimeout = "${testTimeoutSeconds}s", disableVideoRecording = false, disablePerformanceMetrics = true, // Not a useful feature for androidx androidInstrumentationTest = AndroidInstrumentationTest( diff --git a/AndroidXCI/lib/src/main/kotlin/dev/androidx/ci/testRunner/TestRunnerService.kt b/AndroidXCI/lib/src/main/kotlin/dev/androidx/ci/testRunner/TestRunnerService.kt index b426af0..8cddce9 100644 --- a/AndroidXCI/lib/src/main/kotlin/dev/androidx/ci/testRunner/TestRunnerService.kt +++ b/AndroidXCI/lib/src/main/kotlin/dev/androidx/ci/testRunner/TestRunnerService.kt @@ -82,7 +82,8 @@ interface TestRunnerService { pullScreenshots: Boolean = false, cachedTestMatrixFilter: CachedTestMatrixFilter = { true }, testTargets: List? = null, - flakyTestAttempts: Int = 2 + flakyTestAttempts: Int = 2, + testTimeoutSeconds: Int = 2700 ): ScheduleTestsResponse /** diff --git a/AndroidXCI/lib/src/main/kotlin/dev/androidx/ci/testRunner/TestRunnerServiceImpl.kt b/AndroidXCI/lib/src/main/kotlin/dev/androidx/ci/testRunner/TestRunnerServiceImpl.kt index 7fdb6a7..2e3bed9 100644 --- a/AndroidXCI/lib/src/main/kotlin/dev/androidx/ci/testRunner/TestRunnerServiceImpl.kt +++ b/AndroidXCI/lib/src/main/kotlin/dev/androidx/ci/testRunner/TestRunnerServiceImpl.kt @@ -102,7 +102,8 @@ internal class TestRunnerServiceImpl internal constructor( pullScreenshots: Boolean, cachedTestMatrixFilter: CachedTestMatrixFilter, testTargets: List?, - flakyTestAttempts: Int + flakyTestAttempts: Int, + testTimeoutSeconds: Int ): TestRunnerService.ScheduleTestsResponse { val testMatrices = testLabController.submitTests( appApk = appApk ?: apkStore.getPlaceholderApk(), @@ -114,7 +115,8 @@ internal class TestRunnerServiceImpl internal constructor( pullScreenshots = pullScreenshots, cachedTestMatrixFilter = cachedTestMatrixFilter, testTargets = testTargets, - flakyTestAttempts = flakyTestAttempts + flakyTestAttempts = flakyTestAttempts, + testTimeoutSeconds = testTimeoutSeconds ) return TestRunnerService.ScheduleTestsResponse.create( testMatrices