Skip to content

Fixes #3171: Fall back to Throwable Location strategy on Android #3619

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

Merged
merged 1 commit into from
Mar 28, 2025

Conversation

adrianroos
Copy link
Contributor

@adrianroos adrianroos commented Mar 21, 2025

Works around an Android Runtime bug where StackWalker would fail to traverse the stack if a stack frame involves java.lang.Proxy.

Disables StackWalker for Android versions that do not yet include the fix in https://r.android.com/3548340.

This issue was also reported as linkedin/dexmaker#190.

Change-Id: I5b81e552666924302971ee8b84e63865281674dc

Checklist

  • Read the contributing guide
  • PR should be motivated, i.e. what does it fix, why, and if relevant how
  • If possible / relevant include an example in the description, that could help all readers
    including project members to get a better picture of the change
  • Avoid other runtime dependencies
  • Meaningful commit history ; intention is important please rebase your commit history so that each
    commit is meaningful and help the people that will explore a change in 2 years
  • The pull request follows coding style
  • Mention Fixes #<issue number> in the description if relevant
  • At least one commit should mention Fixes #<issue number> if relevant

Works around an Android Runtime bug where StackWalker would fail to
traverse the stack if a stack frame involves java.lang.Proxy.

Disables StackWalker for Android versions that do not yet include the
fix in https://r.android.com/3548340.

This issue was also reported as linkedin/dexmaker#190.

Change-Id: I5b81e552666924302971ee8b84e63865281674dc
@adrianroos adrianroos marked this pull request as ready for review March 21, 2025 16:27
@codecov-commenter
Copy link

codecov-commenter commented Mar 21, 2025

Codecov Report

Attention: Patch coverage is 46.15385% with 7 lines in your changes missing coverage. Please review.

Project coverage is 86.45%. Comparing base (1764e62) to head (7b9fc32).
Report is 4 commits behind head on main.

Files with missing lines Patch % Lines
...ava/org/mockito/internal/util/AndroidPlatform.java 45.45% 5 Missing and 1 partial ⚠️
...rg/mockito/internal/debugging/LocationFactory.java 50.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               main    #3619      +/-   ##
============================================
- Coverage     86.46%   86.45%   -0.02%     
- Complexity     2952     2955       +3     
============================================
  Files           340      341       +1     
  Lines          8971     8984      +13     
  Branches       1103     1103              
============================================
+ Hits           7757     7767      +10     
- Misses          934      935       +1     
- Partials        280      282       +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@TimvdLippe
Copy link
Contributor

@adrianroos thanks for the PR. Can you fix the CI build?

@adrianroos
Copy link
Contributor Author

As far as I can tell this is a flaky test for verify with a delay, but I can't seem to retry the CI run?

@TimvdLippe TimvdLippe merged commit bfab743 into mockito:main Mar 28, 2025
25 of 36 checks passed
svc-squareup-copybara pushed a commit to cashapp/misk that referenced this pull request Apr 7, 2025
| Package | Type | Package file | Manager | Update | Change |
|---|---|---|---|---|---|
| [org.mockito:mockito-core](https://github.com/mockito/mockito) |
dependencies | misk/gradle/libs.versions.toml | gradle | minor |
`5.16.1` -> `5.17.0` |
| [software.amazon.awssdk:sdk-core](https://aws.amazon.com/sdkforjava) |
dependencies | misk/gradle/libs.versions.toml | gradle | patch |
`2.31.15` -> `2.31.16` |
| [software.amazon.awssdk:sqs](https://aws.amazon.com/sdkforjava) |
dependencies | misk/gradle/libs.versions.toml | gradle | patch |
`2.31.15` -> `2.31.16` |
|
[software.amazon.awssdk:dynamodb-enhanced](https://aws.amazon.com/sdkforjava)
| dependencies | misk/gradle/libs.versions.toml | gradle | patch |
`2.31.15` -> `2.31.16` |
| [software.amazon.awssdk:dynamodb](https://aws.amazon.com/sdkforjava) |
dependencies | misk/gradle/libs.versions.toml | gradle | patch |
`2.31.15` -> `2.31.16` |
| [software.amazon.awssdk:aws-core](https://aws.amazon.com/sdkforjava) |
dependencies | misk/gradle/libs.versions.toml | gradle | patch |
`2.31.15` -> `2.31.16` |
| [software.amazon.awssdk:bom](https://aws.amazon.com/sdkforjava) |
dependencies | misk/gradle/libs.versions.toml | gradle | patch |
`2.31.15` -> `2.31.16` |
| [software.amazon.awssdk:auth](https://aws.amazon.com/sdkforjava) |
dependencies | misk/gradle/libs.versions.toml | gradle | patch |
`2.31.15` -> `2.31.16` |

---

### Release Notes

<details>
<summary>mockito/mockito (org.mockito:mockito-core)</summary>

### [`v5.17.0`](https://github.com/mockito/mockito/releases/tag/v5.17.0)

<sup><sup>*Changelog generated by [Shipkit Changelog Gradle
Plugin](https://github.com/shipkit/shipkit-changelog)*</sup></sup>

##### 5.17.0

- 2025-04-04 - [7
commit(s)](mockito/mockito@v5.16.1...v5.17.0)
by Adrian Roos, Andre Kurait, Jan Ouwens, Rafael Winterhalter, Taeik
Lim, Thach Le, Tim van der Lippe
- Fixes [#&#8203;3631](mockito/mockito#3631):
Fix broken banner image link
[(#&#8203;3632)](mockito/mockito#3632)
- Banner image is broken
[(#&#8203;3631)](mockito/mockito#3631)
- Update exception message with mockito-inline
[(#&#8203;3628)](mockito/mockito#3628)
- Clarify structure of commit messages
[(#&#8203;3626)](mockito/mockito#3626)
- Fixes [#&#8203;3622](mockito/mockito#3622):
MockitoExtension fails cleanup when aborted before setup
[(#&#8203;3623)](mockito/mockito#3623)
- MockitoExtension fails cleanup when aborted before setup
[(#&#8203;3622)](mockito/mockito#3622)
- Since mockito-inline has been removed, the exception messages with
`mockito-inline` should be modified.
[(#&#8203;3621)](mockito/mockito#3621)
- Fixes [#&#8203;3171](mockito/mockito#3171):
Fall back to Throwable Location strategy on Android
[(#&#8203;3619)](mockito/mockito#3619)
- Fixes [#&#8203;3615](mockito/mockito#3615) :
broken links to javadoc.io
[(#&#8203;3616)](mockito/mockito#3616)
- Broken links to javadoc.io
[(#&#8203;3615)](mockito/mockito#3615)
- Mocks are not working on particular devices after update Android SDK
from 33 to 34
[(#&#8203;3171)](mockito/mockito#3171)

</details>

---

### Configuration

📅 **Schedule**: Branch creation - "after 6pm every weekday,before 2am
every weekday" in timezone Australia/Melbourne, Automerge - At any time
(no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.

♻ **Rebasing**: Never, or you tick the rebase/retry checkbox.

👻 **Immortal**: This PR will be recreated if closed unmerged. Get
[config help](https://github.com/renovatebot/renovate/discussions) if
that's undesired.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR has been generated by [Renovate
Bot](https://github.com/renovatebot/renovate).

GitOrigin-RevId: 610e79d658b797b4e7b64d856b60fcbe8aa64650
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