You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Test randomization for framework_tests_shard failing on skia gold #192992
RUNNING: cd packages/flutter; ../../bin/flutter test --reporter=expanded --file-reporter=json:/Volumes/Work/s/w/ir/x/t/metrics_1789738816684676.json --test-randomize-ordering-seed=20260918 --fatal-warnings --enable-impeller
testWidgets('Taps on a button can be slided to other buttons', (WidgetTester tester) async {
Trying to repro locally. I'm guessing this is an old bug that a specific random seed just happened to trigger now, in which case it would also occur in flutter/packages.
I can reproduce this on Mac but not on Linux. The --enable-impeller flag is key, but the seed does not matter. So this fails for me on master on my Mac:
flutter test --enable-impeller test/cupertino/action_sheet_test.dart
I checked out a bunch of random commits back to March or so and couldn't find one that passed for me. Though by the time I got to March a bunch of tests were failing (maybe pre-impeller or something).
Edit I'm suspecting this is due to how goldens work local vs. on CI. I think there are lots of approved goldens for this test on CI?
Ok I believe this is an impeller rendering bug. It doesn't seem to be a specific bot's hardware or setup since I see the test both passed and failed on the same bot recently.
I was able to reproduce the flake locally on both my Mac and Linux machines. I produced 3 distinct digests in 20 runs on Linux and 8 in 20 runs on Mac. If I don't use impeller, it's always 1 deterministic digest on both platforms.
Test script
#!/usr/bin/env bash# Loop a golden test under Impeller and tally distinct rendered digests.# N=20 SEED=20260918 TARGET=test/cupertino/action_sheet_test.dart ./impeller_golden_loop.shset -u
N="${N:-20}"
SEED="${SEED:-20260918}"
TARGET="${TARGET:-test/cupertino/action_sheet_test.dart}"
FR="$(git rev-parse --show-toplevel)"||exit 1
cd"$FR/packages/flutter"||exit 1
OUT="$FR/bin/cache/pkg/skia_goldens/packages/flutter/test/cupertino"
RESULTS="/tmp/impeller_runs.txt"
LOGDIR="/tmp/impeller_logs"
mkdir -p "$LOGDIR""$OUT":>"$RESULTS"if [ !-f"$TARGET" ];thenecho"ERROR: target not found: $PWD/$TARGET"exit 1
fihash_file() {
if [ !-f"$1" ];thenecho MISSING
elifcommand -v md5 > /dev/null 2>&1;then
md5 -q "$1"else
md5sum "$1"| cut -d'' -f1
fi
}
hash_all() {
ifcommand -v md5 > /dev/null 2>&1;then
cat "$OUT"/*.png 2>/dev/null | md5 -q
else
cat "$OUT"/*.png 2>/dev/null | md5sum | cut -d'' -f1
fi
}
echo"flutter root : $FR"echo"target : $TARGET"echo"seed : $SEED"echo"golden output: $OUT"echo"run logs : $LOGDIR"echo
i=1
while [ "$i"-le"$N" ];do
rm -f "$OUT"/*.png
if [ "${IMPELLER:-1}"="1" ];then"$FR/bin/flutter"test --update-goldens --enable-impeller "--test-randomize-ordering-seed=$SEED""$TARGET">"$LOGDIR/run_$i.log"2>&1else"$FR/bin/flutter"test --update-goldens "--test-randomize-ordering-seed=$SEED""$TARGET">"$LOGDIR/run_$i.log"2>&1fi
pd="$(hash_file "$OUT/cupertinoActionSheet.press-drag.png")"
pr="$(hash_file "$OUT/cupertinoActionSheet.pressed.png")"
al="$(hash_all)"
cp "$OUT/cupertinoActionSheet.press-drag.png""$LOGDIR/run${i}_press-drag_$pd.png"2>/dev/null
cp "$OUT/cupertinoActionSheet.pressed.png""$LOGDIR/run${i}_pressed_$pr.png"2>/dev/null
printf'%2d press-drag=%s pressed=%s all=%s\n'"$i""$pd""$pr""$al"| tee -a "$RESULTS"if [ "$i"-eq 1 ] && [ "$pd"= MISSING ];thenechoecho"ERROR: first run wrote no goldens. Last 25 lines of $LOGDIR/run_1.log:"
tail -25 "$LOGDIR/run_1.log"exit 1
fi
i=$((i +1))doneechoecho"press-drag digests:"
awk '{print $2}'"$RESULTS"| sort | uniq -c | sort -rn
echoecho"pressed digests:"
awk '{print $3}'"$RESULTS"| sort | uniq -c | sort -rn
echoecho"all-goldens aggregate:"
awk '{print $4}'"$RESULTS"| sort | uniq -c | sort -rn
That sounds good to me with one caveat. Some of what you are talking about is meta testing, testing the tests. I would avoid that and stick to unit tests / integration tests with randomization, even if that means a failure is a flake.
A new RenderTargetCache per test sounds like it may be easier to implement that synchronizing on clearing the cache. That seems like a more holistic solution too since it will cover any cache. I guess we'll have to see what that does to execution times.
I tried coming up with a minimal reproduction in a real app for the GPU synchronization issue, and couldn't reproduce it on either Android running Vulkan or on Mac. I closed the issue. Instead, I'll work on exposing a way to clear the render target cache in response to memory pressure #193015 and also clear it between tests.
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.
Activity
justinmc commentedon Sep 18, 2026
It's this test:
flutter/packages/flutter/test/cupertino/action_sheet_test.dart
Line 852 in 12384f9
Trying to repro locally. I'm guessing this is an old bug that a specific random seed just happened to trigger now, in which case it would also occur in flutter/packages.
justinmc commentedon Sep 18, 2026
I can reproduce this on Mac but not on Linux. The
--enable-impellerflag is key, but the seed does not matter. So this fails for me on master on my Mac:justinmc commentedon Sep 18, 2026
https://flutter-gold.skia.org/detail?grouping=name%3Dcupertino.cupertinoActionSheet.press-drag%26source_type%3Dflutter&digest=d85a7c77d7e7fc4bdb7a974d238aad80
justinmc commentedon Sep 18, 2026
This fails back on 3.47.0. Did we recently add the
--enable-impellerflag on Mac in CI?jtmcdole commentedon Sep 18, 2026
This has been passing in the past, but on the dashboard it recently started flaking.
justinmc commentedon Sep 18, 2026
I checked out a bunch of random commits back to March or so and couldn't find one that passed for me. Though by the time I got to March a bunch of tests were failing (maybe pre-impeller or something).
Edit I'm suspecting this is due to how goldens work local vs. on CI. I think there are lots of approved goldens for this test on CI?
justinmc commentedon Sep 18, 2026
This may be suspicious for rendering flakiness:
flutter/packages/flutter/lib/src/cupertino/dialog.dart
Lines 1311 to 1314 in e4cb8ff
justinmc commentedon Sep 18, 2026
Ok I believe this is an impeller rendering bug. It doesn't seem to be a specific bot's hardware or setup since I see the test both passed and failed on the same bot recently.
I was able to reproduce the flake locally on both my Mac and Linux machines. I produced 3 distinct digests in 20 runs on Linux and 8 in 20 runs on Mac. If I don't use impeller, it's always 1 deterministic digest on both platforms.
Test script
20 runs on Mac
20 runs on Linux
Some images from these local runs:
I'll bisect this, but it's slow going.
justinmc commentedon Sep 21, 2026
One other weird screenshot that I've occasionally seen show up on Mac:
justinmc commentedon Sep 21, 2026
Bisected to: #191096
CC @andywolff @gaaclarke @b-luk
7 remaining items
gaaclarke commentedon Sep 23, 2026
That sounds good to me with one caveat. Some of what you are talking about is meta testing, testing the tests. I would avoid that and stick to unit tests / integration tests with randomization, even if that means a failure is a flake.
A new RenderTargetCache per test sounds like it may be easier to implement that synchronizing on clearing the cache. That seems like a more holistic solution too since it will cover any cache. I guess we'll have to see what that does to execution times.
andywolff commentedon Sep 24, 2026
I tried coming up with a minimal reproduction in a real app for the GPU synchronization issue, and couldn't reproduce it on either Android running Vulkan or on Mac. I closed the issue. Instead, I'll work on exposing a way to clear the render target cache in response to memory pressure #193015 and also clear it between tests.
[Impeller] Add render target cache clearing and test hook (flutter#19…
Reset flutter engine internal state in framework test postTest (flutt…
Reland square corners fix (flutter#194314)
Reland square corners fix (flutter#194314)
Revert: Reland square corners fix (flutter#195436)
[Impeller] Add render target cache clearing and test hook (flutter#19…
Reset flutter engine internal state in framework test postTest (flutt…
Reland square corners fix (flutter#194314)
Revert: Reland square corners fix (flutter#195436)
github-actions commentedon Nov 4, 2026
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of
flutter doctor -vand a minimal reproduction of the issue.[Impeller] Reland clipped BackdropFilter square corners fix (flutter#…