Anki-Android icon indicating copy to clipboard operation
Anki-Android copied to clipboard

Triage Flaky test nothingAppearsInAppBarIfAllAppBarButtonsAreDisabled

Open mikehardy opened this issue 2 years ago • 8 comments

          Flaky test - seen it three times now, always windows runner. I think it needs a little triage (maybe there is something there? windows runners are for instance sometimes slower so it may be exposing a timing issue?) but then should be marked flaky as it impedes velocity
ReviewerTest > [SchedV1] > nothingAppearsInAppBarIfAllAppBarButtonsAreDisabled[SchedV1] FAILED
    net.ankiweb.rsdroid.exceptions.BackendInvalidInputException$BackendCollectionAlreadyOpenException: CollectionAlreadyOpen
        at net.ankiweb.rsdroid.exceptions.BackendInvalidInputException$Companion.fromInvalidInputError(BackendInvalidInputException.kt:34)
        at net.ankiweb.rsdroid.BackendException$Companion.fromError(BackendException.kt:114)
        at net.ankiweb.rsdroid.BackendKt.unpackResult(Backend.kt:323)
        at net.ankiweb.rsdroid.BackendKt.access$unpackResult(Backend.kt:1)
        at net.ankiweb.rsdroid.Backend$runMethodRaw$1.invoke(Backend.kt:130)
        at net.ankiweb.rsdroid.Backend$runMethodRaw$1.invoke(Backend.kt:129)
        at net.ankiweb.rsdroid.Backend.withBackend(Backend.kt:157)
        at net.ankiweb.rsdroid.Backend.runMethodRaw(Backend.kt:129)
        at anki.backend.GeneratedBackend.openCollectionRaw(GeneratedBackend.kt:26)
        at anki.backend.GeneratedBackend.openCollection(GeneratedBackend.kt:39)
        at net.ankiweb.rsdroid.Backend.openCollection(Backend.kt:109)
        at net.ankiweb.rsdroid.Backend.openCollection(Backend.kt:61)
        at com.ichi2.libanki.Storage.openDB$AnkiDroid_playDebug(Storage.kt:107)
        at com.ichi2.libanki.Collection.reopen(Collection.kt:452)
        at com.ichi2.libanki.Collection.reopen$default(Collection.kt:449)
        at com.ichi2.libanki.Collection.<init>(Collection.kt:[195](https://github.com/ankidroid/Anki-Android/actions/runs/5985079816/job/16236820765?pr=14306#step:10:196))
        at com.ichi2.libanki.Storage.collection(Storage.kt:89)
        at com.ichi2.anki.CollectionManager.ensureOpenInner(CollectionManager.kt:229)
        at com.ichi2.anki.CollectionManager.access$ensureOpenInner(CollectionManager.kt:40)
        at com.ichi2.anki.CollectionManager$getColUnsafe$1$1.invoke(CollectionManager.kt:281)
        at com.ichi2.anki.CollectionManager$getColUnsafe$1$1.invoke(CollectionManager.kt:280)
        at com.ichi2.anki.CollectionManager.blockForQueue(CollectionManager.kt:260)
        at com.ichi2.anki.CollectionManager.access$blockForQueue(CollectionManager.kt:40)
        at com.ichi2.anki.CollectionManager$getColUnsafe$1.invoke(CollectionManager.kt:280)
        at com.ichi2.anki.CollectionManager$getColUnsafe$1.invoke(CollectionManager.kt:279)
        at com.ichi2.anki.CollectionManager.logUIHangs(CollectionManager.kt:296)
        at com.ichi2.anki.CollectionManager.getColUnsafe(CollectionManager.kt:279)
        at com.ichi2.anki.CollectionHelper.getCol(CollectionHelper.kt:78)
        at com.ichi2.anki.RobolectricTest.getCol(RobolectricTest.kt:357)
        at com.ichi2.anki.ReviewerTest.setUp(ReviewerTest.kt:59)

Originally posted by @mikehardy in https://github.com/ankidroid/Anki-Android/issues/14306#issuecomment-1694348647

mikehardy avatar Aug 26 '23 14:08 mikehardy

Hello 👋, this issue has been opened for more than 3 months with no activity on it. If the issue is still here, please keep in mind that we need community support and help to fix it! Just comment something like still searching for solutions and if you found one, please open a pull request! You have 7 days until this gets closed automatically

github-actions[bot] avatar Nov 24 '23 14:11 github-actions[bot]

Hello, I am interested in solving this issue.

Venkatesh2507 avatar Jan 09 '24 17:01 Venkatesh2507

Step 1: Determine if the test is still flaky

  • Fork AnkiDroid
  • Clone
  • Make a new Branch
  • Remove the 'Flaky' annotation from the test
    • Recommended: modify tests_unit.yml so only the flaky test is executed
    • Optional: use runTest(times) so the test is executed more than once per run
  • Push the branch
  • Go to GitHub actions on your fork (Actions tab, should look like):
    • https://github.com/ankidroid/Anki-Android/actions/
  • Pick "Unit Tests" in the sidebar
  • "Run Workflow" on your branch until you get a failure of the test
    • If you can't reproduce it after a reasonable number of runs, let us know

Screenshot: GitHub Actions - Unit Tests - Run Workflow

Screenshot 2024-01-24 at 16 18 58 2

reference: runTest(times)

https://github.com/ankidroid/Anki-Android/blob/65c9f9197ef31e223e5ced4950c366883c94205b/AnkiDroid/src/test/java/com/ichi2/testutils/TestClass.kt#L201-L206

david-allison avatar Jan 24 '24 16:01 david-allison

is someone working on this?

GautamCoder4019k avatar Feb 06 '24 16:02 GautamCoder4019k

The bug can still be reproduced [summary of Discord thread], don't know if @Venkatesh2507 is still working on it

There was a conversation on Discord: https://discord.com/channels/368267295601983490/1199718488512663652

david-allison avatar Feb 07 '24 03:02 david-allison

@GautamCoder4019k If you don't get a reply within 24 hours, ping me and feel free to work on it. I'm a little snowed under, but I'll aim to assign you. Feel free to work on it without being assigned

david-allison avatar Feb 09 '24 01:02 david-allison

@Venkatesh2507 are u still working on this issue?

GautamCoder4019k avatar Feb 09 '24 06:02 GautamCoder4019k

Yes I am working on this

Venkatesh2507 avatar Feb 11 '24 07:02 Venkatesh2507

Hello 👋, this issue has been opened for more than 3 months with no activity on it. If the issue is still here, please keep in mind that we need community support and help to fix it! Just comment something like still searching for solutions and if you found one, please open a pull request! You have 7 days until this gets closed automatically

github-actions[bot] avatar May 17 '24 05:05 github-actions[bot]