Skip to content
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

build(ci): upload logs on timeout #16255

Merged
merged 1 commit into from Apr 25, 2024

Conversation

david-allison
Copy link
Member

@david-allison david-allison commented Apr 23, 2024

@david-allison david-allison added the Review High Priority Request for high priority review label Apr 23, 2024
@david-allison
Copy link
Member Author

This PR should not be merged yet, we should rerun it until the failure is replicated

This both moves the linked issue along, and acts as a confirmation of PR functionality

if: failure()
# cancelled() handles test timeouts
# remove when test timeouts cause a failure()
if: failure() || cancelled()
Copy link
Member

@mikehardy mikehardy Apr 23, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It appears it may be (untested) possible to do:

Suggested change
if: failure() || cancelled()
if: '!success()'

...and catch every single case except success, but failure && cancelled also seems sufficient

(https://stackoverflow.com/a/58859404/9910298)

@mikehardy
Copy link
Member

I'll attempt to keep re-running the windows test any time I see it's green, until it goes red.

Please anyone else that sees this with windows unit test run as green re-run it as well, the goal is to have it hang + cancel + upload the logs so until it has a red status here we want to re-run it

@mikehardy
Copy link
Member

mikehardy commented Apr 23, 2024

This might go faster if the matrix was temporarily tweaked to be windows only for unit tests, and a separate just-for-matrix-expansion-only parameter was added to create like 20 windows runs at once

Here is an example that creates the expansion (we would put 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14 etc in there):

And note later in the file the logs need that in their name or they clobber each other:

name: ${{ matrix.api-level }}-${{ matrix.arch }}-${{matrix.target}}-${{matrix.first-boot-delay}}-${{matrix.iteration}}-adb_logs

@david-allison
Copy link
Member Author

I'm frazzled mentally, I can apply a patch at max, or I'll get the change done tomorrow

@mikehardy
Copy link
Member

@mikehardy
Copy link
Member

output is a .bin file 😅 - not sure how to interpret, going to table for the moment it's end of day here too

@david-allison
Copy link
Member Author

david-allison commented Apr 23, 2024

testDefaultForegroundColor times out - that is NOT what I would have expected

with some strings magic + manual editing

====

I added lines starting with -- for the start and end of tests

@david-allison
Copy link
Member Author

david-allison commented Apr 23, 2024

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:271)
at net.ankiweb.rsdroid.BackendKt.access$unpackResult(Backend.kt:1)
at net.ankiweb.rsdroid.Backend$runMethodRaw$1.invoke(Backend.kt:118)
at net.ankiweb.rsdroid.Backend$runMethodRaw$1.invoke(Backend.kt:117)
at net.ankiweb.rsdroid.Backend.withBackend(Backend.kt:131)
at net.ankiweb.rsdroid.Backend.runMethodRaw(Backend.kt:117)
at anki.backend.GeneratedBackend.openCollectionRaw(GeneratedBackend.kt:102)
at anki.backend.GeneratedBackend.openCollection(GeneratedBackend.kt:109)
at net.ankiweb.rsdroid.Backend.openCollection(Backend.kt:98)
at net.ankiweb.rsdroid.Backend.openCollection(Backend.kt:57)
at com.ichi2.libanki.Storage.openDB$AnkiDroid_playDebug(Storage.kt:52)
at com.ichi2.libanki.Collection.reopen(Collection.kt:206)
at com.ichi2.libanki.Collection.reopen$default(Collection.kt:203)
at com.ichi2.libanki.Collection.<init>(Collection.kt:138)
at com.ichi2.libanki.Storage.collection(Storage.kt:40)
at com.ichi2.anki.CollectionManager.ensureOpenInner(CollectionManager.kt:230)
at com.ichi2.anki.CollectionManager.access$ensureOpenInner(CollectionManager.kt:39)
at com.ichi2.anki.CollectionManager$withCol$2.invoke(CollectionManager.kt:101)
at com.ichi2.anki.CollectionManager$withCol$2.invoke(CollectionManager.kt:100)
at com.ichi2.anki.CollectionManager$withQueue$2.invokeSuspend(CollectionManager.kt:86)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:104)
at kotlinx.coroutines.EventLoop.processUnconfinedEvent(EventLoop.common.kt:65)
at kotlinx.coroutines.internal.DispatchedContinuationKt.resumeCancellableWith(DispatchedContinuation.kt:371)
at kotlinx.coroutines.intrinsics.CancellableKt.startCoroutineCancellable(Cancellable.kt:26)
at kotlinx.coroutines.intrinsics.CancellableKt.startCoroutineCancellable$default(Cancellable.kt:21)
at kotlinx.coroutines.CoroutineStart.invoke(CoroutineStart.kt:88)
at kotlinx.coroutines.AbstractCoroutine.start(AbstractCoroutine.kt:123)
at kotlinx.coroutines.BuildersKt__Builders_commonKt.launch(Builders.common.kt:52)
at kotlinx.coroutines.BuildersKt.launch(Unknown Source)
at kotlinx.coroutines.BuildersKt__Builders_commonKt.launch$default(Builders.common.kt:43)
at kotlinx.coroutines.BuildersKt.launch$default(Unknown Source)
at com.ichi2.anki.Reviewer.addFlags(Reviewer.kt:660)
at com.ichi2.anki.Reviewer.onCreateOptionsMenu(Reviewer.kt:677)
at android.app.Activity.$$robo$$android_app_Activity$onCreatePanelMenu(Activity.java:4343)
at android.app.Activity.onCreatePanelMenu(Activity.java)
at androidx.activity.ComponentActivity.onCreatePanelMenu(ComponentActivity.java:520)
at androidx.appcompat.view.WindowCallbackWrapper.onCreatePanelMenu(WindowCallbackWrapper.java:94)
at androidx.appcompat.app.AppCompatDelegateImpl$AppCompatWindowCallback.onCreatePanelMenu(AppCompatDelegateImpl.java:3442)
at androidx.appcompat.app.ToolbarActionBar.populateOptionsMenu(ToolbarActionBar.java:458)
at androidx.appcompat.app.ToolbarActionBar$1.run(ToolbarActionBar.java:58)
at android.os.Handler.$$robo$$android_os_Handler$handleCallback(Handler.java:942)
at android.os.Handler.handleCallback(Handler.java)
at android.os.Handler.$$robo$$android_os_Handler$dispatchMessage(Handler.java:99)
at android.os.Handler.dispatchMessage(Handler.java)
at org.robolectric.shadows.ShadowPausedLooper$IdlingRunnable.doRun(ShadowPausedLooper.java:573)
at org.robolectric.shadows.ShadowPausedLooper$ControlRunnable.run(ShadowPausedLooper.java:536)
at org.robolectric.shadows.ShadowPausedLooper.executeOnLooper(ShadowPausedLooper.java:629)
at org.robolectric.shadows.ShadowPausedLooper.idle(ShadowPausedLooper.java:104)
at org.robolectric.shadows.ShadowPausedLooper.idleIfPaused(ShadowPausedLooper.java:177)
at org.robolectric.android.controller.ActivityController.visible(ActivityController.java:232)
at com.ichi2.anki.RobolectricTest$Companion.startActivityNormallyOpenCollectionWithIntent(RobolectricTest.kt:281)
at com.ichi2.anki.RobolectricTest.startActivityNormallyOpenCollectionWithIntent(RobolectricTest.kt)
at com.ichi2.anki.RobolectricTest.startActivityNormallyOpenCollectionWithIntent$AnkiDroid_playDebugUnitTest(RobolectricTest.kt:339)
at com.ichi2.anki.WhiteboardDefaultForegroundColorTest.getForegroundColor(WhiteboardDefaultForegroundColorTest.kt:43)
at com.ichi2.anki.WhiteboardDefaultForegroundColorTest.testDefaultForegroundColor(WhiteboardDefaultForegroundColorTest.kt:38)
at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
at java.base/java.lang.reflect.Method.invoke(Method.java:580)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:59)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:56)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
at org.junit.rules.TestWatcher$1.evaluate(TestWatcher.java:61)
at org.junit.runners.ParentRunner$3.evaluate(ParentRunner.java:306)
at org.robolectric.RobolectricTestRunner$HelperTestRunner$1.evaluate(RobolectricTestRunner.java:588)
at org.robolectric.internal.SandboxTestRunner$2.lambda$evaluate$2(SandboxTestRunner.java:290)
at org.robolectric.internal.bytecode.Sandbox.lambda$runOnMainThread$0(Sandbox.java:101)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:317)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
at java.base/java.lang.Thread.run(Thread.java:1583)

--> Reviewer.addFlags --> a281a9a

@criticalAY FYI

... I remember the day when long stacktraces used to faze me... those were the days 😅

@criticalAY
Copy link
Contributor

But the col was open for other activities too,

suspend fun getName(resources: Resources): String {
        val overrides = withCol { config.getObject("flagLabels", JSONObject()) }
        return overrides.getStringOrNull(code.toString()) ?: resources.getString(defaultNameRes)
    }

@criticalAY
Copy link
Contributor

criticalAY commented Apr 24, 2024

Copy link
Member

@mikehardy mikehardy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

works!

@mikehardy mikehardy added this pull request to the merge queue Apr 25, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Apr 25, 2024
@david-allison david-allison added this pull request to the merge queue Apr 25, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Apr 25, 2024
@mikehardy mikehardy merged commit de7b85e into ankidroid:main Apr 25, 2024
8 checks passed
@github-actions github-actions bot added this to the 2.18 release milestone Apr 25, 2024
@github-actions github-actions bot removed the Review High Priority Request for high priority review label Apr 25, 2024
@mikehardy
Copy link
Member

slamming this one in outside of queue, queue is rejecting too frequently because of flakes and this is part of fixing the flakes

@mikehardy
Copy link
Member

This was a huge help! Really happy this is in

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants