Skip to content
This repository has been archived by the owner on Mar 6, 2024. It is now read-only.

Speed up allocate_disk_space_page_test #704

Merged
merged 1 commit into from Mar 2, 2022

Conversation

jpnurmi
Copy link
Contributor

@jpnurmi jpnurmi commented Feb 25, 2022

For some reason, find.widgetWithText() takes awfully long for finding
an OutlinedButton with specific text in the confirmation dialog's
widget tree. Replacing it with find.text() makes the operation almost
instant. This does the job fine in this context because tap events
propagate from the non-interactive text label to the OutlinedButton
ancestor.

Before, ~20s:

$ flutter test test/allocate_disk_space
00:20 +40: All tests passed!

After, ~5s:

$ flutter test test/allocate_disk_space
00:05 +40: All tests passed!

For some reason, find.widgetWithText() takes awfully long for finding
an OutlinedButton with specific text in the confirmation dialog's
widget tree. Replacing it with find.text() makes the operation almost
instant. This does the job fine in this context because tap events
propagate from the non-interactive text label to the OutlinedButton
ancestor.

Before, ~20s:

    $ flutter test test/allocate_disk_space
    00:20 +40: All tests passed!

After, ~5s:

    $ flutter test test/allocate_disk_space
    00:05 +40: All tests passed!
Copy link
Contributor

@oSoMoN oSoMoN left a comment

Choose a reason for hiding this comment

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

The gain is even greater on my machine, where the test takes ~38s to run on main, and ~7s with your patch. Very nice!

@jpnurmi jpnurmi merged commit 23c316d into canonical:main Mar 2, 2022
@jpnurmi jpnurmi deleted the allocate-disk-space-test branch March 2, 2022 13:13
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants