Skip to content

ci(examples): fix the example integration test jobs - #1643

Merged
spydon merged 9 commits into
mainfrom
fix/example-integration-tests
Aug 5, 2026
Merged

spydon merged 9 commits into
mainfrom
fix/example-integration-tests

Conversation

@spydon

@spydon spydon commented Aug 5, 2026 •

Copy link
Copy Markdown
Contributor

What

Makes the example integration tests pass, which blocks the release pull request (#1642). That workflow is gated to chore(release) titles, so #1642 was the first time it ever ran: every earlier trigger was skipped (49 skipped runs, 0 completed). Six separate causes, one per platform group.

1. The wait matched the dialog instead of the list (linux, windows, ios)

Those three failed at the same line:

The finder "Found 0 widgets with type "Checkbox" descending from widgets with type
"ListTile" that are ancestors of widgets with text "E2E task 1785919389726467": []"
(used in a call to "tap()") could not find any matching widgets.

After tapping Create the test waited for find.text(createdTitle), which also matches an EditableText holding that title, which is what the dialog still has while it animates away. The wait returned about 100 ms after the tap, long before the insert round trip finished. It passes against a local stack because the insert lands inside that first frame; reproduced by putting a 500 ms delay in front of the local stack.

The waits now use the tile, find.widgetWithText(ListTile, title), which a dialog cannot satisfy.

2. The macOS apps could not open a socket (macos)

ClientException with SocketException: Connection failed
(OS Error: Operation not permitted, errno = 1), address = ...trycloudflare.com

flutter test -d macos runs a real sandboxed app bundle, and flutter create grants it com.apple.security.network.server but not com.apple.security.network.client, so every outgoing connection is denied. The same would happen against 127.0.0.1. The scaffolding step now adds the client entitlement. The other macOS checks are unaffected because test.yml runs flutter test on the Dart VM, with no bundle and so no sandbox.

3. The passkeys example could not build on Apple platforms (macos, ios)

GeneratedPluginRegistrant.swift:20:3: error: 'PasskeysPlugin' is only available in
macOS 13.5 or newer

passkeys_darwin annotates its plugin @available(macOS 13.5, iOS 16.0, *), while the scaffolding writes 10.15 and 13.0. Both deployment targets are now raised for that example.

4. The Android emulator ran without KVM (android)

ProbeKVM: This user doesn't have permissions to use KVM (/dev/kvm).
WARNING | x86_64 emulation may not work without hardware acceleration!
Disabling Linux hardware acceleration.
...
cmd: Failure calling service input: Broken pipe (32)

It spent over twelve minutes booting under software emulation, then stopped responding, before any test ran. Added the udev rule from the android-emulator-runner readme; the emulator now boots in about 90 seconds.

5. web passed but the job never finished (web)

Both suites reported All tests passed, then the step idled until the 45 minute job timeout. The runner script itself never exits: _waitForPort called socket.close(), which only shuts the sending side down, and since nothing reads that socket the resource keeps the process alive. lsof on the hung process shows the CLOSED socket still holding an fd. Only the web target probes a port, which is why only web hung. socket.destroy() releases it and the script exits.

6. The keyboard hid the task under test (android)

Android is the only target with a soft keyboard. The create dialog opens it, and the dialog route then restores focus to the search field the test typed in earlier, so it never closes:

view: Size(411.4, 890.3)    viewInsets.bottom: 312.4    visible area ends at 577.9
checkbox rect: LTRB(16.0, 589.8, 64.0, 637.8)      -> behind the keyboard
Warning: A call to tap() ... derived an Offset (40.0, 613.8) that would not hit test

The new task defaults to Low priority and so sorts last, leaving it outside the visible part of the shortened list: on a phone the taps missed, and on the 320x640 screen the CI emulator actually uses (avdmanager runs with no hardware profile, giving androidboot.qemu.skin=320x640) the tile was never even built.

The test now searches for the task it is working on, so it is the only row on screen at any size, which is also how a user would find it again. Asserting that the row leaves the list after the rename, while the old title is still in the filter, additionally proves the write reached the server. Two rejected alternatives, both disproven by trying them: unfocusing in the app does nothing because focus restoration happens afterwards, and scrolling to the tile overshoots, since it only scrolls one way and pinned the list at the bottom after the rename.

Separately, the new-task dialog overflowed by 27 pixels with the keyboard up and pushed its actions off screen, so its content is now scrollable.

Also

  • Dropped edited from the trigger types. A bot rewriting the description fired it, and with cancel-in-progress that killed a running matrix and started it over; coderabbitai did exactly that mid-run here.
  • The jobs also run when a pull request carries the integration tests label, so the suite can be exercised outside a release. That is how this pull request verified itself.
  • Timeouts in the CRUD test now print what is on screen, which is what separated "the dialog stayed open" from "the row never arrived".
  • The simulator is wiped before the iOS run. Those tests hung waiting for the app's VM service on five of six runs, which is reported to come from stale simulator state. Honest status: mitigation for a flake, not a proven fix.

Testing

All six platforms and both examples green: https://github.com/supabase/supabase-flutter/actions/runs/31004067346

Locally, against a stack behind a delaying proxy:

  • CRUD and passkeys suites on web at 500 ms and 1000 ms latency.
  • CRUD suite on an emulator with CI's 320x640 screen, three consecutive passes, and on a pixel_6.
  • melos format and melos analyze clean from the repository root.

spydon added 2 commits August 5, 2026 11:09
find.text also matches the EditableText of the new-task dialog that is
still animating away, so with real network latency the wait returned
before the created task was in the list and the tap on its checkbox
found nothing.
The scaffolded macOS apps only get the network server entitlement, so
every request to Supabase failed with "Operation not permitted", and the
Android emulator ran without KVM, which made it boot for minutes and
then stop responding.

Also lets any pull request run the suite through an "integration tests"
label, instead of only release pull requests.
@spydon
spydon requested a review from a team as a code owner August 5, 2026 09:10
@spydon spydon added the integration tests Run the example integration tests on this pull request label Aug 5, 2026
@coderabbitai

coderabbitai Bot commented Aug 5, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

The pull request expands integration-test triggers and platform setup, changes port-probe socket cleanup, makes the database CRUD task dialog scrollable, and scopes task assertions to ListTile widgets with improved timeout diagnostics.

Changes

Integration test reliability

Layer / File(s) Summary
Integration test workflow execution
.github/workflows/example-integration-tests.yml, .github/scripts/run_example_integration_tests.dart
The workflow runs for labeled pull requests and configures Android KVM access, iOS simulator boot completion, platform deployment settings, simulator diagnostics, socket cleanup, and verbose iOS test output.
Task dialog layout
examples/database_crud/lib/main.dart
The new-task dialog uses a SingleChildScrollView while preserving its existing controls and behavior.
Task tile assertions
examples/database_crud/integration_test/tasks_test.dart
Task creation, rename, and deletion checks use scoped ListTile finders. Timeout failures include visible labels and text-field contents.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Suggested reviewers: tr00d

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the primary change: fixing example integration test jobs in CI.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/example-integration-tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

spydon added 3 commits August 5, 2026 12:13
With the keyboard up on a phone the dialog overflowed by 27 pixels and
pushed its actions off screen, so the task could not be created.
…or first

The port probe closed its socket, which only shuts the sending side down.
Nothing read the socket, so it kept the runner alive after the tests
finished and the web job ran into its timeout with everything green.

Also raises the passkeys deployment targets, since its plugin needs
macOS 13.5 and iOS 16 rather than the scaffolded 10.15 and 13.0, and
waits for the simulator to finish booting.
A bot editing the pull request body fired the edited event, which with
cancel-in-progress killed the matrix mid-run and started it over.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.github/scripts/run_example_integration_tests.dart:
- Around line 64-66: Run melos format and melos analyze from the repository
root, then resolve any formatting or analysis findings before merging. Keep the
socket.destroy() behavior unchanged.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 97ef161a-a637-4126-bd77-2c3e2b8dcc77

📥 Commits

Reviewing files that changed from the base of the PR and between 5984941 and 5fe44f7.

📒 Files selected for processing (3)
  • .github/scripts/run_example_integration_tests.dart
  • .github/workflows/example-integration-tests.yml
  • examples/database_crud/lib/main.dart

spydon added 4 commits August 5, 2026 13:14
A timeout now prints what is on screen, which separates a dialog that
stayed open from a row that never arrived, and the iOS run prints the
tooling and simulator logs so the hang between the build and the first
test can be placed.
… list

On a phone the dialog leaves the keyboard up and the list only fits a
couple of tiles, so the new task sat below the fold and the taps on its
checkbox and icons missed. Filtering the list to the task keeps it on
screen on any screen size, and asserting the row leaves the list after
the rename also proves the write reached the server.

Verified on an emulator with the 320x640 screen CI uses and on a
pixel_6, as well as on web.
The tests hung waiting for the app's VM service on five of the last six
iOS runs, which is reported to come from stale simulator state, so the
device is wiped before it boots. Drops the verbose flag again now that
the hang has been placed.
@spydon
spydon merged commit 1862f74 into main Aug 5, 2026
32 checks passed
@spydon
spydon deleted the fix/example-integration-tests branch August 5, 2026 13:37
spydon added a commit that referenced this pull request Aug 14, 2026
## What

Makes the example integration tests pass, which blocks the release pull
request (#1642). That workflow is gated to `chore(release)` titles, so
#1642 was the first time it ever ran: every earlier trigger was skipped
(49 skipped runs, 0 completed). Six separate causes, one per platform
group.

## 1. The wait matched the dialog instead of the list (linux, windows,
ios)

Those three failed at the same line:

```
The finder "Found 0 widgets with type "Checkbox" descending from widgets with type
"ListTile" that are ancestors of widgets with text "E2E task 1785919389726467": []"
(used in a call to "tap()") could not find any matching widgets.
```

After tapping **Create** the test waited for `find.text(createdTitle)`,
which also matches an `EditableText` holding that title, which is what
the dialog still has while it animates away. The wait returned about 100
ms after the tap, long before the insert round trip finished. It passes
against a local stack because the insert lands inside that first frame;
reproduced by putting a 500 ms delay in front of the local stack.

The waits now use the tile, `find.widgetWithText(ListTile, title)`,
which a dialog cannot satisfy.

## 2. The macOS apps could not open a socket (macos)

```
ClientException with SocketException: Connection failed
(OS Error: Operation not permitted, errno = 1), address = ...trycloudflare.com
```

`flutter test -d macos` runs a real sandboxed app bundle, and `flutter
create` grants it `com.apple.security.network.server` but not
`com.apple.security.network.client`, so every outgoing connection is
denied. The same would happen against `127.0.0.1`. The scaffolding step
now adds the client entitlement. The other macOS checks are unaffected
because `test.yml` runs `flutter test` on the Dart VM, with no bundle
and so no sandbox.

## 3. The passkeys example could not build on Apple platforms (macos,
ios)

```
GeneratedPluginRegistrant.swift:20:3: error: 'PasskeysPlugin' is only available in
macOS 13.5 or newer
```

`passkeys_darwin` annotates its plugin `@available(macOS 13.5, iOS 16.0,
*)`, while the scaffolding writes 10.15 and 13.0. Both deployment
targets are now raised for that example.

## 4. The Android emulator ran without KVM (android)

```
ProbeKVM: This user doesn't have permissions to use KVM (/dev/kvm).
WARNING | x86_64 emulation may not work without hardware acceleration!
Disabling Linux hardware acceleration.
...
cmd: Failure calling service input: Broken pipe (32)
```

It spent over twelve minutes booting under software emulation, then
stopped responding, before any test ran. Added the udev rule from the
`android-emulator-runner` readme; the emulator now boots in about 90
seconds.

## 5. web passed but the job never finished (web)

Both suites reported `All tests passed`, then the step idled until the
45 minute job timeout. The runner script itself never exits:
`_waitForPort` called `socket.close()`, which only shuts the sending
side down, and since nothing reads that socket the resource keeps the
process alive. `lsof` on the hung process shows the `CLOSED` socket
still holding an fd. Only the web target probes a port, which is why
only web hung. `socket.destroy()` releases it and the script exits.

## 6. The keyboard hid the task under test (android)

Android is the only target with a soft keyboard. The create dialog opens
it, and the dialog route then restores focus to the search field the
test typed in earlier, so it never closes:

```
view: Size(411.4, 890.3)    viewInsets.bottom: 312.4    visible area ends at 577.9
checkbox rect: LTRB(16.0, 589.8, 64.0, 637.8)      -> behind the keyboard
Warning: A call to tap() ... derived an Offset (40.0, 613.8) that would not hit test
```

The new task defaults to Low priority and so sorts last, leaving it
outside the visible part of the shortened list: on a phone the taps
missed, and on the 320x640 screen the CI emulator actually uses
(`avdmanager` runs with no hardware profile, giving
`androidboot.qemu.skin=320x640`) the tile was never even built.

The test now searches for the task it is working on, so it is the only
row on screen at any size, which is also how a user would find it again.
Asserting that the row leaves the list after the rename, while the old
title is still in the filter, additionally proves the write reached the
server. Two rejected alternatives, both disproven by trying them:
unfocusing in the app does nothing because focus restoration happens
afterwards, and scrolling to the tile overshoots, since it only scrolls
one way and pinned the list at the bottom after the rename.

Separately, the new-task dialog overflowed by 27 pixels with the
keyboard up and pushed its actions off screen, so its content is now
scrollable.

## Also

- Dropped `edited` from the trigger types. A bot rewriting the
description fired it, and with `cancel-in-progress` that killed a
running matrix and started it over; `coderabbitai` did exactly that
mid-run here.
- The jobs also run when a pull request carries the `integration tests`
label, so the suite can be exercised outside a release. That is how this
pull request verified itself.
- Timeouts in the CRUD test now print what is on screen, which is what
separated "the dialog stayed open" from "the row never arrived".
- The simulator is wiped before the iOS run. Those tests hung waiting
for the app's VM service on five of six runs, which is reported to come
from stale simulator state. Honest status: mitigation for a flake, not a
proven fix.

## Testing

All six platforms and both examples green:
https://github.com/supabase/supabase-flutter/actions/runs/31004067346

Locally, against a stack behind a delaying proxy:

- CRUD and passkeys suites on web at 500 ms and 1000 ms latency.
- CRUD suite on an emulator with CI's 320x640 screen, three consecutive
passes, and on a pixel_6.
- `melos format` and `melos analyze` clean from the repository root.
spydon added a commit that referenced this pull request Aug 14, 2026
Release for the `gotrue` 2.27.x maintenance line, targeting
`release/gotrue-2.27.x`. Ships the Wasm `Session.fromJson` fix merged in
#1719.

## Versions

| Package | Version | Reason |
| --- | --- | --- |
| `gotrue` | 2.27.1 to 2.27.2 | The fix itself |
| `supabase` | 2.16.0 to 2.16.1 | Dependency was updated |
| `supabase_flutter` | 2.17.1 to 2.17.2 | Dependency was updated |

The two dependent bumps are required rather than incidental. The
published `supabase` 2.16.0 pins `gotrue: 2.27.1` exactly and
`supabase_flutter` 2.17.1 pins `supabase: 2.16.0` exactly, so publishing
`gotrue` on its own would not reach anyone using the higher level
packages. The release commit rewrites those pins to 2.27.2 and 2.16.1
respectively.

## The example integration tests needed #1643 backported

This branch is cut at the `gotrue-v2.27.1` tag, which is commit #1642,
and #1643 landed immediately after it. That is the commit that made
these tests pass in the first place, so the branch sits at the last
commit where they were still broken.

The suite is gated on `startsWith(github.event.pull_request.title,
'chore(release)')`, so it only runs on release pull requests. That is
why #1719 skipped it and why this pull request is the first thing on the
branch to trigger it, in the same way #1642 was the first trigger ever.

The first run here failed on four platforms at three different lines,
matching the causes #1643 describes:

- `linux` at line 76, `find.text(createdTitle)` matched the create
dialog's own text field while it was still animating away, so the
following `ListTile` lookup had nothing to descend from.
- `macos` at line 50, the seeded `Book flights` row was below the fold.
- `windows` at line 97, the renamed row still matched the old title.

`1862f74c` is cherry picked here unchanged. Its parent is exactly this
branch's base commit, so it applied without conflict.

## storage_client is deliberately excluded

#1719 was squash merged, so its single `fix(gotrue):` commit also
touches `packages/storage_client/lib/src/storage_client.dart` and the
`supabase_flutter` example's Gradle files. Left alone, `melos version`
therefore also proposed `storage_client` 2.8.1.

That bump was suppressed with `--ignore storage_client`, because the
only change to that package is an `// ignore: use_super_parameters`
comment added to keep the pipeline green. Publishing it would ship a
no-op version whose changelog entry reads "FIX(gotrue): parse expires_in
as num in Session.fromJson", and would consume 2.8.1 on a line where
`main` is still at 2.8.0.

## Before publishing

`release-tag.yml` only triggers on pushes to `main`, so merging this
will not create the tags. They need to be pushed manually, or that
workflow needs a `workflow_dispatch` trigger, before
`release-publish.yml` can be dispatched against `gotrue-v2.27.2`.

## How this was generated

`melos version --yes --ignore="storage_client" --no-git-tag-version`,
matching the flags `release-prepare.yml` uses apart from the added
filter, which the workflow has no input for. `dart pub get` resolves the
workspace and `dart analyze packages/gotrue` is clean at these versions.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

integration tests Run the example integration tests on this pull request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants