Skip to content

Conversation

@polina-c
Copy link
Contributor

@polina-c polina-c commented Jan 10, 2024

No description provided.

@github-actions github-actions bot added the framework flutter/packages/flutter repository. See also f: labels. label Jan 10, 2024
@polina-c polina-c marked this pull request as ready for review January 10, 2024 18:52
@polina-c polina-c changed the title [Not for merge] Debug leak tracking Fix mechanism to pass flag for leak tracking. Jan 10, 2024
@flutter-dashboard
Copy link

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 "@test-exemption-reviewer" in the #hackers channel in Chat (don't just cc them here, they won't see it! Use Discord!).

If you are not sure if you need tests, consider this rule of thumb: the purpose of a test is to make sure someone doesn't accidentally revert the fix. Ask yourself, is there anything in your PR that you feel it is important we not accidentally revert back to how it was before your fix?

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

// to provide a way to detect if the env variable is passed as expected on bots, that is not obvious.
// Sometimes the bot's environment contains `LEAK_TRACKING=true` but the value is not passed to the test.
// https://github.com/dart-lang/sdk/issues/54568
debugPrint('Leak tracking is enabled.');
Copy link
Contributor

Choose a reason for hiding this comment

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

Could you validate this by export LEAK_TRACKING=true, and run the test locally? If validated, then no need to add this print.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Nope, it does not work locally:

polinach-macbookpro3:flutter polinach$ echo $LEAK_TRACKING
true
polinach-macbookpro3:flutter polinach$  flutter test /Users/polinach/_/flutter_dev/packages/flutter/test/widgets/page_view_test.dart
00:03 +33: All tests passed!                                                                               
polinach-macbookpro3:flutter polinach$  flutter test --dart-define LEAK_TRACKING=true /Users/polinach/_/flutter_dev/packages/flutter/test/widgets/page_view_test.dart
00:01 +0: loading /Users/polinach/_/flutter_dev/packages/flutter/test/widgets/page_view_test.dart                                                                              
Leak tracking is enabled.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

But it works on bots

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That's why I filed a bug: dart-lang/sdk#54568

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Refiled to flutter: #141299

Copy link
Contributor

Choose a reason for hiding this comment

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

Hum, weird, it works for me locally with your patch const bool.fromEnvironment('LEAK_TRACKING') || (bool.tryParse(Platform.environment['LEAK_TRACKING'] ?? '') ?? false);:

keyonghan-macbookpro2:test keyonghan$ echo $LEAK_TRACKING
true
keyonghan-macbookpro2:test keyonghan$ flutter test /Users/keyonghan/Documents/work/flutter/packages/flutter/test/widgets/page_view_test.dart
Changing current working directory to: /Users/keyonghan/Documents/work/flutter/packages/flutter
00:01 +0: loading /Users/keyonghan/Documents/work/flutter/packages/flutter/test/widgets/page_view_test.dart                                                                                                 
Leak tracking is enabled.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Weird

Added version information to the bug.

Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: add a TODO to remove after the reference issue is fixed.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@stuartmorgan found what is wrong: #141299

Removed print.

@polina-c polina-c requested a review from keyonghan January 10, 2024 19:44
Copy link
Contributor

@keyonghan keyonghan left a comment

Choose a reason for hiding this comment

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

LGTM with nit.

// to provide a way to detect if the env variable is passed as expected on bots, that is not obvious.
// Sometimes the bot's environment contains `LEAK_TRACKING=true` but the value is not passed to the test.
// https://github.com/dart-lang/sdk/issues/54568
debugPrint('Leak tracking is enabled.');
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: add a TODO to remove after the reference issue is fixed.

@polina-c polina-c added autosubmit Merge PR when tree becomes green via auto submit App and removed autosubmit Merge PR when tree becomes green via auto submit App labels Jan 10, 2024
@polina-c polina-c added the autosubmit Merge PR when tree becomes green via auto submit App label Jan 10, 2024
@auto-submit auto-submit bot merged commit 420b15a into flutter:master Jan 10, 2024
@polina-c polina-c deleted the debug branch January 10, 2024 22:09
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jan 11, 2024
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jan 11, 2024
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jan 11, 2024
auto-submit bot pushed a commit to flutter/packages that referenced this pull request Jan 11, 2024
flutter/flutter@b840a60...9f2e681

2024-01-11 dnfield@google.com [Tool][Impeller] Make impellerc produce Vulkan and GLES shaders for Android. (flutter/flutter#140976)
2024-01-11 engine-flutter-autoroll@skia.org Roll Packages from 378e700 to 0744fe6 (6 revisions) (flutter/flutter#141378)
2024-01-11 engine-flutter-autoroll@skia.org Roll Flutter Engine from efd0eb62f4aa to ecdaed76f284 (1 revision) (flutter/flutter#141359)
2024-01-11 engine-flutter-autoroll@skia.org Roll Flutter Engine from ade9f18fa008 to efd0eb62f4aa (2 revisions) (flutter/flutter#141356)
2024-01-11 engine-flutter-autoroll@skia.org Roll Flutter Engine from 42e3e0236112 to ade9f18fa008 (2 revisions) (flutter/flutter#141337)
2024-01-11 engine-flutter-autoroll@skia.org Roll Flutter Engine from f39f5ca18328 to 42e3e0236112 (2 revisions) (flutter/flutter#141327)
2024-01-11 engine-flutter-autoroll@skia.org Roll Flutter Engine from 431d64dbb4b8 to f39f5ca18328 (1 revision) (flutter/flutter#141322)
2024-01-11 katelovett@google.com Add dart fix support to flutter_driver (flutter/flutter#141300)
2024-01-11 polinach@google.com Fix a leak. (flutter/flutter#141312)
2024-01-10 katelovett@google.com Add covariants to reduce subclass casts in 2D APIs (flutter/flutter#141318)
2024-01-10 engine-flutter-autoroll@skia.org Roll Flutter Engine from a045134c910d to 431d64dbb4b8 (2 revisions) (flutter/flutter#141316)
2024-01-10 engine-flutter-autoroll@skia.org Roll Flutter Engine from 6810c9a57460 to a045134c910d (2 revisions) (flutter/flutter#141313)
2024-01-10 jmccandless@google.com Call onPopInvoked when pages API is used (flutter/flutter#141221)
2024-01-10 polinach@google.com Fix mechanism to pass flag for leak tracking. (flutter/flutter#141226)
2024-01-10 engine-flutter-autoroll@skia.org Roll Flutter Engine from 5d252831e62c to 6810c9a57460 (2 revisions) (flutter/flutter#141308)
2024-01-10 engine-flutter-autoroll@skia.org Roll Flutter Engine from 6cb256fc4985 to 5d252831e62c (1 revision) (flutter/flutter#141302)
2024-01-10 engine-flutter-autoroll@skia.org Roll Flutter Engine from 52aedc6c9153 to 6cb256fc4985 (1 revision) (flutter/flutter#141297)
2024-01-10 polinach@google.com Improve testing for leak tracking. (flutter/flutter#140553)
2024-01-10 engine-flutter-autoroll@skia.org Roll Flutter Engine from d1a2007a28b4 to 52aedc6c9153 (2 revisions) (flutter/flutter#141291)
2024-01-10 christopherfujino@gmail.com [flutter_tools] fix flutter create -t skeleton (flutter/flutter#141233)
2024-01-10 engine-flutter-autoroll@skia.org Roll Flutter Engine from b361a60ae224 to d1a2007a28b4 (1 revision) (flutter/flutter#141285)
2024-01-10 derekx@google.com Unpin package:vm_service (flutter/flutter#141279)
2024-01-10 stuartmorgan@google.com Collapse pubspec.lock by default (flutter/flutter#141282)
2024-01-10 engine-flutter-autoroll@skia.org Roll Packages from 09205ca to 378e700 (2 revisions) (flutter/flutter#141275)

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/flutter-packages
Please CC camillesimon@google.com,rmistry@google.com,stuartmorgan@google.com on the revert to ensure that a human
is aware of the problem.

To file a bug in Packages: https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

autosubmit Merge PR when tree becomes green via auto submit App framework flutter/packages/flutter repository. See also f: labels.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants