-
Notifications
You must be signed in to change notification settings - Fork 6.8k
fix(overlay): only clear duplicate containers from different platform #17006
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(overlay): only clear duplicate containers from different platform #17006
Conversation
baf8cc8
to
1b30154
Compare
@@ -63,6 +68,11 @@ describe('MatSelectHarness', () => { | |||
|
|||
/** Shared tests to run on both the original and MDC-based select. */ | |||
function runTests() { | |||
afterEach(() => { | |||
// Angular won't call this for us so we need to do it ourselves to avoid leaks. | |||
overlayContainer.ngOnDestroy(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need these changes, because the changes to the container revealed that the tests here are leaking overlay containers. I've fixed it for all harnesses in #17007.
dca378f
to
f11389b
Compare
Addressed the feedback @jelbourn. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
539c6a9
to
ea785ba
Compare
Any updates on this? I'm seeing issues due to #16851 and verified that this PR resolves them. |
Looks like this has 80+ failures inside Google for a number of projects. Will require further debugging |
ea785ba
to
299e423
Compare
I'm bumping the priority on this, because we keep getting reports about it. |
299e423
to
97c67f1
Compare
I spent a bit debugging this. Turns out that people have been unintentionally depending on the current behavior in their unit tests in that it guarantees that there's exactly one overlay container. With the changes in this PR, overlay containers aren't cleaned up between specs, so tests just start failing whenever they expect something about a particular overlay container and get a different one (one test I looked at had 21 overlay containers). This is pretty widespread; the change breaks 170 test targets. I feel like the real solution would be to introduce something like |
That's interesting, considering that we weren't clearing the overlay containers for at least two and a half years. I'm pushing a change that'll clear them if it detects that it's running inside in a testing context with a TODO to remove it once we have an overlay testing module. |
Currently we clear all overlay containers when we create a new one as a way to avoid duplicate content coming in from the server. Our current approach is a little too aggressive, because it can pick up containers from different apps. These changes add an extra attribute to the container so that we can determine which platform it's coming from. Fixes angular#16851.
97c67f1
to
e5c93fc
Compare
…#17006) Currently we clear all overlay containers when we create a new one as a way to avoid duplicate content coming in from the server. Our current approach is a little too aggressive, because it can pick up containers from different apps. These changes add an extra attribute to the container so that we can determine which platform it's coming from. Fixes #16851. (cherry picked from commit 29eec77)
…angular#17006) Currently we clear all overlay containers when we create a new one as a way to avoid duplicate content coming in from the server. Our current approach is a little too aggressive, because it can pick up containers from different apps. These changes add an extra attribute to the container so that we can determine which platform it's coming from. Fixes angular#16851.
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Currently we clear all overlay containers when we create a new one as a way to avoid duplicate content coming in from the server. Our current approach is a little too aggressive, because it can pick up containers from different apps. These changes add an extra attribute to the container so that we can determine which platform it's coming from.
Fixes #16851.