Skip to content

Conversation

@mklim
Copy link
Contributor

@mklim mklim commented Oct 10, 2019

Description

The flake appears to be coming from the Google Maps plugin. This test
just needs a platform view plugin without the interface method
implemented in general, not Maps specifically. Update it here to avoid
the issue in Maps until that's fixed.

Create a very simple platform view implementation that exercises this
potential bug in order to create a minimal test case with less risk of
causing second order issues like depending on any kind of full package
would cause.

Related Issues

Fixes #42349
See also #42451

Tests

  • Updated abstract_method_smoke_test

Checklist

Before you create this PR confirm that it meets all requirements listed below by checking the relevant checkboxes ([x]). This will ensure a smooth and quick review process.

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • I signed the CLA.
  • I read and followed the Flutter Style Guide, including Features we expect every widget to implement.
  • I updated/added relevant documentation (doc comments with ///).
  • All existing and new tests are passing.
  • The analyzer (flutter analyze --flutter-repo) does not report any problems on my PR.
  • I am willing to follow-up on review comments in a timely manner.

Breaking Change

Does your PR require Flutter developers to manually update their apps to accommodate your change?

  • Yes, this is a breaking change (Please read Handling breaking changes). Replace this with a link to the e-mail where you asked for input on this proposed change.
  • No, this is not a breaking change.

@mklim mklim added the a: tests "flutter test", flutter_test, or one of our tests label Oct 10, 2019
@mklim mklim requested review from blasten and dnfield October 10, 2019 17:56
@fluttergithubbot
Copy link
Contributor

It looks like this pull request may not have tests. Please make sure to add tests before merging. If you need an exemption to this rule, contact Hixie.

Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing.

@fluttergithubbot fluttergithubbot added the c: contributor-productivity Team-specific productivity, code health, technical debt. label Oct 10, 2019
The flake appears to be coming from the Google Maps plugin. This test
just needs a platform view plugin without the interface method
implemented in general, not Maps specifically.  Update it here to avoid
the issue in Maps until that's fixed.
Copy link
Contributor

@dnfield dnfield left a comment

Choose a reason for hiding this comment

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

LGTM!

@mklim
Copy link
Contributor Author

mklim commented Oct 10, 2019

Hmm. Is there a way to tell the analyzer to ignore an "invalid" dependency? I'm deliberately using an outdated version of webview_flutter because that's the version of the package that would cause this test to go red without the fix. I know normally you can use ignore: for analyzer lints, but I'm having trouble finding the right name for this one.

ETA: I "fixed" this by temporarily locally patching update_packages.dart to have a pinned manual dependency so that it created a "valid" CHECKSUM and then committing that, but I don't think that's the right way to go long term. The next time this needs to be --force-upgraded for some other reason I think it will be overwritten. But I don't want to actually add this package into update_packages.dart as a globally pinned dependency because we really shouldn't be pinning the dependency to this universally, it's an old version. We just want to use it for this one integration test. It would be better if we could exclude this check for this line or directory somehow. WDYT @dnfield ?

This was done by locally patching `update_packages.dart` to have a new
manually pinned dependency on webview_flutter: 0.3.9+1.
@codecov
Copy link

codecov bot commented Oct 10, 2019

Codecov Report

Merging #42454 into master will decrease coverage by 0.69%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff            @@
##           master   #42454     +/-   ##
=========================================
- Coverage   60.37%   59.68%   -0.7%     
=========================================
  Files         194      194             
  Lines       18849    18849             
=========================================
- Hits        11381    11250    -131     
- Misses       7468     7599    +131
Flag Coverage Δ
#flutter_tool 59.68% <ø> (-0.7%) ⬇️
Impacted Files Coverage Δ
...tter_tools/lib/src/build_system/targets/linux.dart 38.29% <0%> (-46.81%) ⬇️
packages/flutter_tools/lib/src/web/web_device.dart 7.22% <0%> (-40.97%) ⬇️
packages/flutter_tools/lib/src/ios/mac.dart 31.66% <0%> (-22.58%) ⬇️
packages/flutter_tools/lib/src/base/build.dart 58.67% <0%> (-15.71%) ⬇️
...ages/flutter_tools/lib/src/linux/linux_doctor.dart 75% <0%> (-15%) ⬇️
packages/flutter_tools/lib/src/asset.dart 82.62% <0%> (-3.39%) ⬇️
...ckages/flutter_tools/lib/src/reporting/events.dart 92.95% <0%> (-2.82%) ⬇️
packages/flutter_tools/lib/src/device.dart 63.25% <0%> (-2.41%) ⬇️
packages/flutter_tools/lib/src/context_runner.dart 67.24% <0%> (-1.73%) ⬇️
packages/flutter_tools/lib/src/cache.dart 47.54% <0%> (-1.64%) ⬇️
... and 6 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 6a63ef7...8766433. Read the comment docs.

@mklim
Copy link
Contributor Author

mklim commented Oct 10, 2019

🤦‍♂️ I forgot that there was a webview bug in this version that was fixed in later versions, https://firebase.corp.google.com/u/0/project/flutter-infra/testlab/histories/bh.1b29258e8f97b976/matrices/8877227498452021020/executions/bs.32007b1eae22dd0. I'm going to just rewrite this to use a custom platform view that does nothing. Sorry about the back and forth.

Before, the test was depending on a specific package version that
demonstrated the potential bug. However the flutter analyzer demands
updated package versions and we'd need to work around it here to keep
the version in sync.

In addition to that the old package version itself had a different bug
in addition to the previous bug this patch is avoiding from the _other_
package that previously caused the test to fail in CI. The newer version
of the package without the bug also didn't exercise the right code path
to make this test meaningful.

Create a very simple platform view implementation that exercises this
potential bug in order to create a minimal test case with less risk of
causing second order issues like depending on any kind of full package
would cause.
@mklim
Copy link
Contributor Author

mklim commented Oct 10, 2019

OK, updated the test to use a simple custom platform view instead of relying on a plugin at all. @blasten and @dnfield please take a look at the latest patches when you have a minute, the PR has changed a bit since last LGTM.

view.setBackgroundColor(Color.CYAN)
}

override fun dispose() {}
Copy link

Choose a reason for hiding this comment

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

not sure if the empty dispose() is needed, but just in case.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hard to tell in Kotlin, but the original class is a Java interface so it's still needed here.

@blasten
Copy link

blasten commented Oct 10, 2019

LGTM. Thanks for the effort to track this down :)

@mklim mklim merged commit 6d18d31 into flutter:master Oct 11, 2019
@mklim mklim deleted the real_deflake branch October 11, 2019 01:23
Inconnu08 pushed a commit to Inconnu08/flutter that referenced this pull request Nov 26, 2019
The flake appears to be coming from the Google Maps plugin. This test
just needs a platform view plugin without the interface method
implemented in general, not Maps specifically. Update it here to avoid
the issue in Maps until that's fixed.

Create a very simple platform view implementation that exercises this
potential bug in order to create a minimal test case with less risk of
causing second order issues like depending on any kind of full package
would cause.
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 3, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

a: tests "flutter test", flutter_test, or one of our tests c: contributor-productivity Team-specific productivity, code health, technical debt.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Android Firebase Test Lab run is flaky because PlatformException(error, Neither user 10218 nor current process has android.permission.WAKE_LOCK., null)

5 participants