Skip to content

Commit 0fbc51e

Browse files
committed
ci(flet-test): non-blocking android logcat dump; linux GL diagnostics
Android: stop streaming logcat live (verbose device logs bog down the software emulator and stall the job); instead dump the relevant slice of the ring buffer after the run with non-blocking 'adb logcat -d'. Linux: add a failure-diagnostic step that reports the active GL renderer (glxinfo) and runs the built bundle directly to surface its exit-79 crash output, which the test harness otherwise swallows.
1 parent 8cd0297 commit 0fbc51e

1 file changed

Lines changed: 32 additions & 9 deletions

File tree

.github/workflows/flet-test.yml

Lines changed: 32 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,30 @@ jobs:
168168
GALLIUM_DRIVER: llvmpipe
169169
run: ${{ matrix.test_cmd }}
170170

171+
# -------- Linux: on failure, surface the GL renderer + the bundle's own
172+
# crash output (the test harness swallows the app's early exit-79). --------
173+
- name: Diagnose Linux failure
174+
if: failure() && matrix.platform == 'linux'
175+
shell: bash
176+
working-directory: ${{ env.APP_DIR }}
177+
env:
178+
LIBGL_ALWAYS_SOFTWARE: "true"
179+
GALLIUM_DRIVER: llvmpipe
180+
run: |
181+
echo "::group::glxinfo (is llvmpipe active?)"
182+
xvfb-run -a glxinfo -B 2>&1 | head -30 || echo "glxinfo unavailable"
183+
echo "::endgroup::"
184+
echo "::group::Run built Linux bundle directly"
185+
BUNDLE="$(find build/flutter/build/linux -type f -name flet_test_counter | head -1)"
186+
echo "bundle: ${BUNDLE:-<not found>}"
187+
if [ -n "$BUNDLE" ]; then
188+
set +e
189+
xvfb-run -a "$BUNDLE" 2>&1 | head -80
190+
echo "bundle exit: ${PIPESTATUS[0]}"
191+
set -e
192+
fi
193+
echo "::endgroup::"
194+
171195
# -------- Run: Android (inside the emulator) --------
172196
- name: Run flet test (android)
173197
if: matrix.platform == 'android'
@@ -180,20 +204,19 @@ jobs:
180204
disable-animations: true
181205
emulator-options: -no-snapshot -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim
182206
working-directory: ${{ env.APP_DIR }}
183-
# Capture device-side logs (embedded Python stdout/stderr, Flet, Flutter,
184-
# crashes) so on-device failures are diagnosable from the CI log, then
185-
# dump them after the run regardless of outcome.
207+
# Don't stream logcat live (verbose device logs bog down the software
208+
# emulator). Run the test, then dump the relevant slice of the logcat
209+
# ring buffer afterwards (non-blocking `-d`) so on-device failures
210+
# (embedded Python stdout/stderr, native crashes) are diagnosable.
186211
script: |
187212
adb logcat -c || true
188-
adb logcat -v time flet.python:V flutter:V python:V DartVM:V \
189-
ActivityManager:I AndroidRuntime:E libc:E DEBUG:E '*:S' > /tmp/logcat.txt 2>&1 &
190-
LOGCAT_PID=$!
191213
set +e
192214
uv run flet test android -d emulator-5554 --python-version ${PYTHON_VERSION} --yes -v
193215
CODE=$?
194216
set -e
195-
kill "$LOGCAT_PID" 2>/dev/null || true
196-
echo "::group::adb logcat (device-side)"
197-
cat /tmp/logcat.txt || true
217+
echo "::group::adb logcat (device-side, post-run dump)"
218+
adb logcat -d -v time \
219+
flet.python:V python:V stdout:V stderr:V \
220+
AndroidRuntime:E DEBUG:E libc:E '*:S' | tail -n 400 || true
198221
echo "::endgroup::"
199222
exit $CODE

0 commit comments

Comments
 (0)