From cf01784241b95c8b9d349fc27e67116737b8bae4 Mon Sep 17 00:00:00 2001 From: Krzysztof kuhy Rudnicki Date: Mon, 2 Nov 2026 10:28:26 +0100 Subject: [PATCH] TODO: flaky image_store_io attach test Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01WzxdWY1k4muZfdVJfb7YGJ --- ...-fix-image-store-io-attach-pathnotfound.md | 27 +++++++++++++++++++ pubspec.yaml | 2 +- 2 files changed, 28 insertions(+), 1 deletion(-) create mode 100644 TODO-fix-image-store-io-attach-pathnotfound.md diff --git a/TODO-fix-image-store-io-attach-pathnotfound.md b/TODO-fix-image-store-io-attach-pathnotfound.md new file mode 100644 index 0000000..822322f --- /dev/null +++ b/TODO-fix-image-store-io-attach-pathnotfound.md @@ -0,0 +1,27 @@ +# Fix flaky image_store_io_test "without picker copies everything is copied" + +## what +`test/attachments/image_store_io_test.dart` "attachFile without picker copies +everything is copied" fails about 1 run in 4 under parallel load with +`PathNotFoundException: Cannot retrieve length of file` from +`ImageCacheStore._run` (`lib/images/image_cache_store.dart:135`). The test +returns while `IoImageStore.attachFile` still has its fire-and-forget +`unawaited(_sync(const {}))` running; teardown deletes the temp root and the +upload pass calls `file.length()` on a file that `existsSync()` just saw. +Predates the AccountManager branch (no file in lib/images, lib/attachments or +test/attachments was touched). Seen once as 591/592 and once with +`--reporter expanded` at 635/636. + +## done +`for i in $(seq 20); do flutter test test/attachments/image_store_io_test.dart --concurrency=4 || exit 1; done` +exits 0, and the production path tolerates a file vanishing mid-pass (skip it +instead of throwing). + +## verify +Same loop on this repo; plus the full suite ends with "All tests passed!". + +## read first +- lib/attachments/image_store_io.dart (`attachFile`, `_sync`) +- lib/images/image_cache_store.dart (`_run`) + +REMOVE ME AFTER FINISH diff --git a/pubspec.yaml b/pubspec.yaml index efc89d3..cec52cd 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -16,7 +16,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html # In Windows, build-name is used as the major, minor, and patch parts # of the product and file versions while build-number is used as the build suffix. -version: 1.0.50+1 +version: 1.0.51+1 environment: sdk: ^3.12.2