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

Kaspresso rewrite original stack on internal espresso errors #639

Closed
VladislavSumin opened this issue Apr 8, 2024 · 1 comment · Fixed by #661 or #666
Closed

Kaspresso rewrite original stack on internal espresso errors #639

VladislavSumin opened this issue Apr 8, 2024 · 1 comment · Fixed by #661 or #666
Labels
bug Something isn't working

Comments

@VladislavSumin
Copy link
Collaborator

Describe the bug
When we receive an error inside the espresso library, kaspresso replaces the stacktrace with its own, and the original stacktrace is lost. It happens here -

}.apply { stackTrace = Thread.currentThread().stackTrace }
.
Example of espresso internal error - KakaoCup/Kakao#60

Instead of the original stack we get this:

StackTrace
java.lang.NullPointerException
  at dalvik.system.VMStack.getThreadStackTrace(Native Method)
  at java.lang.Thread.getStackTrace(Thread.java:1736)
  at com.kaspersky.kaspresso.failure.FailureLoggingProviderImpl.describedWith(FailureLoggingProviderImpl.kt:96)
  at com.kaspersky.kaspresso.failure.FailureLoggingProviderImpl.logDescriptionAndThrow(FailureLoggingProviderImpl.kt:69)
  at com.kaspersky.kaspresso.failure.LoggingFailureHandler.logDescriptionAndThrow(Unknown Source:2)
  at com.kaspersky.kaspresso.failure.LoggingFailureHandler.handle(LoggingFailureHandler.kt:21)
  at androidx.test.espresso.ViewInteraction.waitForAndHandleInteractionResults(ViewInteraction.java:8)
  at androidx.test.espresso.ViewInteraction.desugaredPerform(ViewInteraction.java:11)
  at androidx.test.espresso.ViewInteraction.perform(ViewInteraction.java:8)
  at com.kaspersky.kaspresso.interceptors.tolibrary.kakao.KakaoViewInterceptor$interceptPerform$1.invoke(KakaoViewInterceptor.kt:46)
  at com.kaspersky.kaspresso.interceptors.tolibrary.kakao.KakaoViewInterceptor$interceptPerform$1.invoke(KakaoViewInterceptor.kt:44)
  at com.kaspersky.kaspresso.autoscroll.AutoScrollProviderImpl.withAutoScroll(AutoScrollProviderImpl.kt:31)
  at com.kaspersky.kaspresso.interceptors.behavior.impl.autoscroll.AutoScrollViewBehaviorInterceptor.withAutoScroll(Unknown Source:12)
  at com.kaspersky.kaspresso.interceptors.behavior.impl.autoscroll.AutoScrollViewBehaviorInterceptor.intercept(AutoScrollViewBehaviorInterceptor.kt:26)
  at com.kaspersky.kaspresso.interceptors.behavior.impl.autoscroll.AutoScrollViewBehaviorInterceptor.intercept(AutoScrollViewBehaviorInterceptor.kt:14)
  at com.kaspersky.kaspresso.interceptors.tolibrary.kakao.KakaoViewInterceptor$interceptPerform$2$1.invoke(KakaoViewInterceptor.kt:51)
  at com.kaspersky.kaspresso.interceptors.tolibrary.kakao.KakaoViewInterceptor$interceptPerform$2$1.invoke(KakaoViewInterceptor.kt:51)
  at com.kaspersky.kaspresso.systemsafety.SystemDialogSafetyProviderImpl.passSystemDialogs(SystemDialogSafetyProviderImpl.kt:60)
  at com.kaspersky.kaspresso.interceptors.behavior.impl.systemsafety.SystemDialogSafetyViewBehaviorInterceptor.passSystemDialogs(Unknown Source:7)
  at com.kaspersky.kaspresso.interceptors.behavior.impl.systemsafety.SystemDialogSafetyViewBehaviorInterceptor.intercept(SystemDialogSafetyViewBehaviorInterceptor.kt:30)
  at com.kaspersky.kaspresso.interceptors.behavior.impl.systemsafety.SystemDialogSafetyViewBehaviorInterceptor.intercept(SystemDialogSafetyViewBehaviorInterceptor.kt:16)
  at com.kaspersky.kaspresso.interceptors.tolibrary.kakao.KakaoViewInterceptor$interceptPerform$2$1.invoke(KakaoViewInterceptor.kt:51)
  at com.kaspersky.kaspresso.interceptors.tolibrary.kakao.KakaoViewInterceptor$interceptPerform$2$1.invoke(KakaoViewInterceptor.kt:51)
  at com.kaspersky.kaspresso.flakysafety.algorithm.FlakySafetyAlgorithm.invokeFlakySafely(FlakySafetyAlgorithm.kt:32)
  at com.kaspersky.kaspresso.flakysafety.algorithm.FlakySafetyAlgorithm.invokeFlakySafely$default(FlakySafetyAlgorithm.kt:22)
  at com.kaspersky.kaspresso.flakysafety.FlakySafetyProviderSimpleImpl.flakySafely(FlakySafetyProviderSimpleImpl.kt:27)
  at com.kaspersky.kaspresso.interceptors.behavior.impl.flakysafety.FlakySafeViewBehaviorInterceptor.flakySafely(Unknown Source:7)
  at com.kaspersky.kaspresso.interceptors.behavior.impl.flakysafety.FlakySafeViewBehaviorInterceptor.intercept(FlakySafeViewBehaviorInterceptor.kt:26)
  at com.kaspersky.kaspresso.interceptors.behavior.impl.flakysafety.FlakySafeViewBehaviorInterceptor.intercept(FlakySafeViewBehaviorInterceptor.kt:14)
  at com.kaspersky.kaspresso.interceptors.tolibrary.kakao.KakaoViewInterceptor$interceptPerform$2$1.invoke(KakaoViewInterceptor.kt:51)
  at com.kaspersky.kaspresso.interceptors.tolibrary.kakao.KakaoViewInterceptor$interceptPerform$2$1.invoke(KakaoViewInterceptor.kt:51)
  at com.kaspersky.kaspresso.interceptors.tolibrary.kakao.KakaoViewInterceptor.interceptPerform(KakaoViewInterceptor.kt:53)
  at com.kaspersky.kaspresso.interceptors.tolibrary.KakaoLibraryInjector$injectKaspressoInKakao$1$1$2.invoke(KakaoLibraryInjector.kt:57)
  at com.kaspersky.kaspresso.interceptors.tolibrary.KakaoLibraryInjector$injectKaspressoInKakao$1$1$2.invoke(KakaoLibraryInjector.kt:57)
  at io.github.kakaocup.kakao.delegate.Delegate$DefaultImpls.interceptOnPerform(Delegate.kt:68)
  at io.github.kakaocup.kakao.delegate.Delegate$DefaultImpls.interceptPerform$intercept$3(Delegate.kt:44)
  at io.github.kakaocup.kakao.delegate.Delegate$DefaultImpls.interceptPerform(Delegate.kt:49)
  at io.github.kakaocup.kakao.delegate.ViewInteractionDelegate.interceptPerform(ViewInteractionDelegate.kt:21)
  at io.github.kakaocup.kakao.delegate.ViewInteractionDelegate.interceptPerform(ViewInteractionDelegate.kt:21)
  at io.github.kakaocup.kakao.delegate.ViewInteractionDelegate.perform(ViewInteractionDelegate.kt:41)
  at io.github.kakaocup.kakao.recycler.RecyclerActions$DefaultImpls.scrollToEnd(RecyclerActions.kt:30)
  at <PRIVATE_PACKAGE_REMOVED>.CustomRecyclerView.scrollToEnd(...)
  at <PRIVATE_PACKAGE_REMOVED>.SomeTest$someTest$1$2$4$2$1.invoke(...)

Expected behavior
The original error is attached as suppressedExceptions

Screenshots
NONE

Desktop (please complete the following information):
ANY

Smartphone (please complete the following information):
ANY

Additional context
Add any other context about the problem here.

@Nikitae57
Copy link
Collaborator

Closed too soon

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
2 participants