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

Upgrade android emulator and caching #1543

Merged
merged 6 commits into from
Jul 17, 2023
Merged

Conversation

marandaneto
Copy link
Contributor

📜 Description

#skip-changelog

💡 Motivation and Context

  1. Error: Timeout waiting for emulator to boot.
  2. significantly reduce emulator startup time by setting up AVD snapshot caching.
    https://github.com/ReactiveCircus/android-emulator-runner

💚 How did you test it?

📝 Checklist

  • I reviewed submitted code
  • I added tests to verify changes
  • No new PII added or SDK only sends newly added PII if sendDefaultPii is enabled
  • I updated the docs if needed
  • All tests passing
  • No breaking changes

🔮 Next steps

@codecov
Copy link

codecov bot commented Jul 10, 2023

Codecov Report

Patch and project coverage have no change.

Comparison is base (1e094d3) 91.11% compared to head (ed616a5) 91.11%.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1543   +/-   ##
=======================================
  Coverage   91.11%   91.11%           
=======================================
  Files          61       61           
  Lines        2048     2048           
=======================================
  Hits         1866     1866           
  Misses        182      182           

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@marandaneto marandaneto mentioned this pull request Jul 10, 2023
6 tasks
api-level: 21
force-avd-creation: false
emulator-options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
disable-animations: false
Copy link
Member

@krystofwoldrich krystofwoldrich Jul 10, 2023

Choose a reason for hiding this comment

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

L: Should this also be true? I guess we don't need animation anywhere.

Suggested change
disable-animations: false
disable-animations: true

Copy link
Member

Choose a reason for hiding this comment

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

I've noticed that in the actions' repo it is also with enabled animations, but that must be a typo, or does it have a side effect?
https://github.com/ReactiveCircus/android-emulator-runner

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No idea, I'd keep it as it is tho since it's following the https://github.com/ReactiveCircus/android-emulator-runner example.

with:
working-directory: ./flutter/example
api-level: 21
force-avd-creation: false
emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
Copy link
Member

@krystofwoldrich krystofwoldrich Jul 10, 2023

Choose a reason for hiding this comment

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

L: Here it's not that long, so it's good, but in case there would be more params we can use YML multiline string > that replaces new lines with spaces.

          emulator-options: >
            -noaudio
            ...

https://github.com/getsentry/sentry-react-native/blob/da1b6a88c430816aafb4ed733863395007d667c8/.github/workflows/e2e.yml#L434-L435

Copy link
Member

@krystofwoldrich krystofwoldrich left a comment

Choose a reason for hiding this comment

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

Looks good 🚀, I left two comments.

I've noticed the bootup timeout quite a bit in RN too, so I will definitely add this there too.

@stefanosiano
Copy link
Member

Just a note, I tried to do the same on the Java repo, but the cache actually made tests slower and sometimes they timed out, so I had to revert it.
Let's run it a few times to check it really improves timings

@github-actions
Copy link
Contributor

github-actions bot commented Jul 14, 2023

Android Performance metrics 🚀

  Plain With Sentry Diff
Startup time 298.72 ms 364.42 ms 65.70 ms
Size 6.16 MiB 7.14 MiB 1004.21 KiB

Baseline results on branch: main

Startup times

Revision Plain With Sentry Diff
abcdba3 354.68 ms 399.04 ms 44.36 ms
ebfead1 298.44 ms 374.28 ms 75.84 ms
8d64376 302.88 ms 356.84 ms 53.96 ms
e5b744f 302.70 ms 342.17 ms 39.47 ms
43760f9 321.78 ms 366.77 ms 44.99 ms
5aba417 355.78 ms 450.39 ms 94.61 ms
521cfbf 332.78 ms 376.04 ms 43.26 ms
aa950e9 337.42 ms 400.72 ms 63.30 ms
56810ff 309.72 ms 352.26 ms 42.54 ms
379d7a8 327.10 ms 355.39 ms 28.29 ms

App size

Revision Plain With Sentry Diff
abcdba3 5.94 MiB 6.95 MiB 1.01 MiB
ebfead1 6.06 MiB 7.03 MiB 989.24 KiB
8d64376 5.94 MiB 6.96 MiB 1.02 MiB
e5b744f 6.06 MiB 7.09 MiB 1.03 MiB
43760f9 6.15 MiB 7.13 MiB 1000.49 KiB
5aba417 5.94 MiB 6.96 MiB 1.02 MiB
521cfbf 5.94 MiB 6.97 MiB 1.03 MiB
aa950e9 5.94 MiB 6.96 MiB 1.02 MiB
56810ff 5.94 MiB 6.92 MiB 1001.71 KiB
379d7a8 5.94 MiB 6.95 MiB 1.01 MiB

Previous results on branch: chore/android-emulator-upgrade

Startup times

Revision Plain With Sentry Diff
b18a28a 325.67 ms 423.33 ms 97.66 ms
5c077a9 294.66 ms 347.00 ms 52.34 ms

App size

Revision Plain With Sentry Diff
b18a28a 6.16 MiB 7.14 MiB 1003.98 KiB
5c077a9 6.16 MiB 7.14 MiB 1003.98 KiB

@github-actions
Copy link
Contributor

github-actions bot commented Jul 14, 2023

iOS Performance metrics 🚀

  Plain With Sentry Diff
Startup time 1249.76 ms 1268.06 ms 18.31 ms
Size 8.29 MiB 9.37 MiB 1.08 MiB

Baseline results on branch: main

Startup times

Revision Plain With Sentry Diff
a817b8f 1261.90 ms 1264.62 ms 2.73 ms
6aab859 1245.14 ms 1247.59 ms 2.45 ms
e66e71e 1273.55 ms 1291.63 ms 18.08 ms
8cb6557 1265.14 ms 1266.08 ms 0.94 ms
3a69405 1292.84 ms 1303.96 ms 11.12 ms
f96ca24 1264.39 ms 1287.98 ms 23.59 ms
521cfbf 1258.94 ms 1275.18 ms 16.25 ms
aed5947 1268.67 ms 1281.10 ms 12.43 ms
870f5eb 1267.78 ms 1286.86 ms 19.08 ms
90db9ff 1277.18 ms 1283.69 ms 6.51 ms

App size

Revision Plain With Sentry Diff
a817b8f 8.29 MiB 9.37 MiB 1.07 MiB
6aab859 8.29 MiB 9.36 MiB 1.07 MiB
e66e71e 8.10 MiB 9.08 MiB 1004.36 KiB
8cb6557 8.10 MiB 9.18 MiB 1.08 MiB
3a69405 8.15 MiB 9.15 MiB 1018.56 KiB
f96ca24 8.10 MiB 9.08 MiB 1004.36 KiB
521cfbf 8.16 MiB 9.17 MiB 1.01 MiB
aed5947 8.16 MiB 9.17 MiB 1.01 MiB
870f5eb 8.15 MiB 9.13 MiB 1000.08 KiB
90db9ff 8.10 MiB 9.08 MiB 1004.27 KiB

Previous results on branch: chore/android-emulator-upgrade

Startup times

Revision Plain With Sentry Diff
b18a28a 1219.08 ms 1236.10 ms 17.02 ms
5c077a9 1254.34 ms 1275.24 ms 20.90 ms

App size

Revision Plain With Sentry Diff
b18a28a 8.29 MiB 9.37 MiB 1.08 MiB
5c077a9 8.29 MiB 9.37 MiB 1.08 MiB

profile: Nexus 6
script: flutter test integration_test/integration_test.dart --verbose
- name: Gradle cache
uses: gradle/gradle-build-action@v2
Copy link
Contributor

Choose a reason for hiding this comment

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

  • 🚫 Please pin the action by specifying a commit SHA instead of a tag/branch.

@marandaneto marandaneto merged commit 0f0a612 into main Jul 17, 2023
76 of 81 checks passed
@marandaneto marandaneto deleted the chore/android-emulator-upgrade branch July 17, 2023 16:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants