Skip to content
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 PluginBuildPluginTests on mac #47622

Closed

Conversation

alpar-t
Copy link
Contributor

@alpar-t alpar-t commented Oct 5, 2019

We skip the thread leak check because it seems Gradle is leaking them
and there's nothing we can do.

Closes #47417.

We skip the thread leak check because it seems Gradle is leaking them
and there's nothing we can do.

Closes elastic#47417.
@alpar-t alpar-t added :Delivery/Build Build or test infrastructure >test-failure Triaged test failures from CI v8.0.0 v7.5.0 labels Oct 5, 2019
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-core-infra (:Core/Infra/Build)

@rjernst
Copy link
Member

rjernst commented Oct 5, 2019

What changed in gradle? This seems to have come about not from an upgrade of gradle, but from changes in our build. I'm concerned relaxing this check is only opening the door for us doing something silly in our build. Applying a plugin should not be spinning off threads?

@alpar-t
Copy link
Contributor Author

alpar-t commented Oct 7, 2019

@rjernst we didn't have a Test like this before, it's a newly added one , so we just saw this now. It's very hard to track this down, since the build plugin does a bunch of things. Perhaps we can get back to this once we manage to chop it up a bit ? I understand and share your concern, but since we don't start threads as part of the build at all, and this only happens on mac I'm fairly sure this is a Gradle issues and one that will take a lot of time to chase down that could be put to better use right now

@rjernst
Copy link
Member

rjernst commented Oct 7, 2019

With @mark-vieira I tracked this down to GlobalBuildInfoPlugin, which uses project.exec on macos. It appears gradle is using some kind of pooled executor, which keeps threads around for future exec calls.

Instead of masking all threads, can we use a threadfilter? I think this should apply in the base gradle test case as it could happen with any projectbuilder, we just haven't hit it yet because nothing was applying GlobalBuildInfoPlugin in code.

I think the filter would look something like this:

On GradleUnitTestCase

@ThreadLeakFilters(defaultFilters = true, filters = {
    GradleExecThreadsFilter.class
})

And a new class:

public class GradleExecThreadsFilter implements ThreadFilter {
    @Override
    public boolean reject(Thread t) {
        return t.getName().startsWith("Exec process");
    }
}

@rjernst
Copy link
Member

rjernst commented Oct 7, 2019

I opened #47713 with my above suggestion (it passes for me locally).

@alpar-t alpar-t closed this Oct 8, 2019
@alpar-t alpar-t deleted the fix-plugin-build-plugin-test-mac branch November 11, 2019 09:37
@mark-vieira mark-vieira added the Team:Delivery Meta label for Delivery team label Nov 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:Delivery/Build Build or test infrastructure Team:Delivery Meta label for Delivery team >test-failure Triaged test failures from CI v7.5.0 v8.0.0-alpha1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

PluginBuildPluginTests fails on Mac
5 participants