-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CI: Timeouts on Windows Unit Tests #16253
Comments
@david-allison - are the logs still uploading? I don't see windows log artifacts and that would be a very useful thing to have to troubleshoot this |
I suspect the failure reason isn't 'failed', so logs are skipped perhaps: |
Diagnostics: #16255 (comment) --> Reviewer.addFlags --> a281a9a |
I see this resolution as being 4-pronged:
|
My read (from intuition) is that This may just require |
This one here is what I would prioritize first, fail-fast and (IMNSHO) fail-correctly vs fail-ambiguously |
My read (from intuition) is that This may just require To get an exception from the
|
|
This comment was marked as duplicate.
This comment was marked as duplicate.
The following does NOT make tests fail early Index: AnkiDroid/src/main/java/com/ichi2/libanki/Storage.kt
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/AnkiDroid/src/main/java/com/ichi2/libanki/Storage.kt b/AnkiDroid/src/main/java/com/ichi2/libanki/Storage.kt
--- a/AnkiDroid/src/main/java/com/ichi2/libanki/Storage.kt (revision 638209ed4989872d528fedd845772b4187d80df2)
+++ b/AnkiDroid/src/main/java/com/ichi2/libanki/Storage.kt (revision 0daf248ba9a11f454b15ec2dadb783294b84d7c3)
@@ -18,8 +18,10 @@
import com.ichi2.anki.getDayStart
import com.ichi2.libanki.utils.Time
import com.ichi2.libanki.utils.TimeManager.time
+import com.ichi2.utils.isRobolectric
import net.ankiweb.rsdroid.Backend
import net.ankiweb.rsdroid.BackendFactory
+import net.ankiweb.rsdroid.exceptions.BackendInvalidInputException.BackendCollectionAlreadyOpenException
import java.io.File
object Storage {
@@ -49,7 +51,12 @@
if (afterFullSync) {
create = false
} else {
- backend.openCollection(if (isInMemory) ":memory:" else path)
+ try {
+ backend.openCollection(if (isInMemory) ":memory:" else path)
+ } catch (e: BackendCollectionAlreadyOpenException) {
+ if (!isRobolectric) throw e
+ throw Error("BackendCollectionAlreadyOpenException", e)
+ }
}
val db = DB.withRustBackend(backend) See: https://github.com/david-allison/Anki-Android/actions/runs/8855405150 |
Reproduction of hang (runs on macOS) Index: AnkiDroid/src/main/java/com/ichi2/anki/Reviewer.kt
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/AnkiDroid/src/main/java/com/ichi2/anki/Reviewer.kt b/AnkiDroid/src/main/java/com/ichi2/anki/Reviewer.kt
--- a/AnkiDroid/src/main/java/com/ichi2/anki/Reviewer.kt (revision 9036f1611380e2952630527dd26483e9d4772805)
+++ b/AnkiDroid/src/main/java/com/ichi2/anki/Reviewer.kt (date 1714178146303)
@@ -40,7 +40,9 @@
import androidx.appcompat.widget.Toolbar
import androidx.core.app.ActivityCompat
import androidx.core.content.ContextCompat
+import androidx.lifecycle.lifecycleScope
import androidx.vectordrawable.graphics.drawable.VectorDrawableCompat
+import anki.backend.BackendError
import anki.frontend.SetSchedulingStatesRequest
import com.google.android.material.color.MaterialColors
import com.google.android.material.snackbar.Snackbar
@@ -87,6 +89,8 @@
import com.ichi2.utils.Permissions.canRecordAudio
import com.ichi2.utils.ViewGroupUtils.setRenderWorkaround
import com.ichi2.widget.WidgetStatus.updateInBackground
+import kotlinx.coroutines.launch
+import net.ankiweb.rsdroid.exceptions.BackendInvalidInputException
import timber.log.Timber
import java.io.File
@@ -682,6 +686,9 @@
@NeedsTest("Order of operations needs Testing around Menu (Overflow) Icons and their colors.")
override fun onCreateOptionsMenu(menu: Menu): Boolean {
Timber.d("onCreateOptionsMenu()")
+ lifecycleScope.launch {
+ throw BackendInvalidInputException.BackendCollectionAlreadyOpenException(BackendError.getDefaultInstance())
+ }
// NOTE: This is called every time a new question is shown via invalidate options menu
menuInflater.inflate(R.menu.reviewer, menu)
displayIcons(menu) |
The hang appears to be: https://github.com/ACRA/acra/blob/0c2b36ceb873f75b7528cd76f2fefec3f0d5ac23/acra-core/src/main/java/org/acra/interaction/ReportInteractionExecutor.kt#L50 Caused by an uncaught exception ( |
Applied a fix, we'll know for certain: https://github.com/david-allison/Anki-Android/actions/runs/8859500839/job/24329333389 |
Proposal on the anti-flake script: fail if the branch is Avoids user error when forgetting to select a branch |
But...I want to run it on main sometimes? If a flake slips through we will want to run it on main to verify ? |
Any way we can confirm that we want to run it on main? I currently have "ad blindness" when it comes to branch selection, this might go away with time now it's a necessary field to change |
old
First failure seems to be ~3 days ago
https://github.com/ankidroid/Anki-Android/actions/runs/8767647456/job/24061139040
But we had a similar issue with
dependency-updates
My suspicion is that the cause is:
But this needs triage
Things to do to close this:
- this didn't workBackendCollectionAlreadyOpenException
needs to be caught and re-thrown as an Error if in the robolectric execution context so this becomes fail-fast - the thinking is that this is a hang because it is an Exception instead of an Error. The commit from fix: Use flags from col, dynamically loading them into the menu #16218 can be used provisionally in combination with a matrix of 10+ iterations running on windows in order to trigger the conditionThread.UncaughtExceptionHandler
to catch the errorThe text was updated successfully, but these errors were encountered: