Skip to content

KiwixSettingsScreenTest fails intermittently on emulators with no external storage volume #5105

Description

@soloturn

AI-assisted issue. Filed by agent driven by @soloturn via GDD.

Summary

KiwixSettingsScreenTest.testSettingsScreenCommonBehaviour has been failing intermittently in CI, on runs triggered by PRs with no relation to the settings screen or storage handling:

Root cause

SettingsRobot.clickExternalStoragePreference() / assertExternalStorageSelected() hardcode index 1 into the storage-device node list:

fun clickExternalStoragePreference(composeTestRule: ComposeContentTestRule) {
  clickOnStorageItem(1, composeTestRule)
}

That list is populated in SettingsScreen.kt's storageCategory() from settingsUiState.storageDeviceList.forEachIndexed { ... } - one entry per volume the device/emulator actually reports. Internal storage is always present (index 0), but an external/SD volume is not guaranteed on every CI emulator configuration. When it's absent, the list has only one entry, and:

Both are the exact same bug, manifesting differently depending on which of the two call sites is hit.

Fix

Fixed in #5104: added SettingsRobot.hasExternalStorageDevice() and gated the external-storage steps in testSettingsScreenCommonBehaviour on it, leaving internal-storage coverage and the rest of the test unconditional.

Related

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions