-
Notifications
You must be signed in to change notification settings - Fork 216
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
First paparazzi test in module takes too long time #1662
Comments
Do you mind providing a sample project that reproduces the issue? |
I can't share this project, it's prohibited. But I can try to reproduce this issue at sample project |
The first test bootstraps Layoutlib via Bridge.init and statically caches it for subsequent runs, which explain why you notice a drop after the first test. However, ~20s is high and I've never seen this before. I suspect you may just be running the tests with a conservative heap size; if so, bumping the max heap size should be enough to fix this. |
Okay, thanks for reply. Is it possible to cache and share Layoutlib between all modules? Now each module init Layoutlib when running tests. |
This is a Gradle design issue. Each module has its own test task, which I believe runs in its own process via the test runner. If I'm understanding this correctly, then the answer to your question would be "no". What's your current CI heap size? Have you tried increasing it? |
We run tests in docker container with params |
I have tried an android screenshot testing (https://developer.android.com/studio/preview/compose-screenshot-testing). |
@jrodbx I posted a proposal to gradle gradle/gradle#31332 so that there is a way to bypass this restriction |
Gradle recommend to use build |
How coulid I use build_services to store Layoutlib instance for all runs? |
Schematically then something like this, but I have not studied the implementation of Paparazzi
|
Description
We have multimodule android project. Every module contains some different paparazzi tests.
First launchable test method in first test class always takes too long time. It runs in ~20s. The next tests takes 0.5 - 2s.
The same in the different modules.
What's the cause of the freeze? How to speed up tests launch?
Steps to Reproduce
Run paparazzi tests with multiple test methods for whole module. Use gradle task
./gradlew :feature:verifyPaparazziDebug
Additional information:
Screenshots
Test reports:
1
2
The text was updated successfully, but these errors were encountered: