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

NPE in SnapshotVerifier during tests #340

Closed
luizgrp opened this issue Jul 7, 2022 · 2 comments
Closed

NPE in SnapshotVerifier during tests #340

luizgrp opened this issue Jul 7, 2022 · 2 comments

Comments

@luizgrp
Copy link
Member

luizgrp commented Jul 7, 2022

Most of the tests are failing in CI with:

java.lang.NullPointerException: goldenImage must not be null
	at app.cash.paparazzi.SnapshotVerifier$newFrameHandler$1.handle(SnapshotVerifier.kt:53)
	at com.google.android.horologist.paparazzi.WearSnapshotHandler$newFrameHandler$1.handle(WearSnapshotHandler.kt:57)
	at app.cash.paparazzi.Paparazzi$takeSnapshots$1$2.invoke(Paparazzi.kt:302)
	at app.cash.paparazzi.Paparazzi$takeSnapshots$1$2.invoke(Paparazzi.kt:295)
	at app.cash.paparazzi.Paparazzi.withTime(Paparazzi.kt:336)
	at app.cash.paparazzi.Paparazzi.takeSnapshots(Paparazzi.kt:295)
	at app.cash.paparazzi.Paparazzi.snapshot(Paparazzi.kt:211)
	at app.cash.paparazzi.Paparazzi.snapshot(Paparazzi.kt:204)
	at app.cash.paparazzi.Paparazzi.snapshot$default(Paparazzi.kt:195)
	at com.google.android.horologist.media.ui.FigmaVolumeScreenTest.volumePlayerScreen(FigmaVolumeScreenTest.kt:46)

The stacktrace above can be seen in the test reports in the archived artifact. In the actions logs it displays the following:

com.google.android.horologist.media.ui.FigmaVolumeScreenTest > volumePlayerScreen FAILED
    java.lang.NullPointerException at FigmaVolumeScreenTest.kt:46

...

53 tests completed, 35 failed
> Task :media-ui:testDebugUnitTest FAILED

Some investigation reported here.

Usage of WearSnapshotHandler was removed in #338 for now.

@luizgrp luizgrp changed the title Tests causing NPE in WearSnapshotHandler NPE in WearSnapshotHandler during tests Jul 7, 2022
@luizgrp
Copy link
Member Author

luizgrp commented Jul 7, 2022

After #338 was merged, now a PR up to date with develop also failed with NPE:

java.lang.NullPointerException: goldenImage must not be null
	at app.cash.paparazzi.SnapshotVerifier$newFrameHandler$1.handle(SnapshotVerifier.kt:53)
	at app.cash.paparazzi.Paparazzi$takeSnapshots$1$2.invoke(Paparazzi.kt:302)
	at app.cash.paparazzi.Paparazzi$takeSnapshots$1$2.invoke(Paparazzi.kt:295)
	at app.cash.paparazzi.Paparazzi.withTime(Paparazzi.kt:336)
	at app.cash.paparazzi.Paparazzi.takeSnapshots(Paparazzi.kt:295)
	at app.cash.paparazzi.Paparazzi.snapshot(Paparazzi.kt:211)
	at app.cash.paparazzi.Paparazzi.snapshot(Paparazzi.kt:204)
	at app.cash.paparazzi.Paparazzi.snapshot$default(Paparazzi.kt:195)
	at com.google.android.horologist.audio.ui.VolumeScreenIndividualTest.volumeScreenAtMaximum(VolumeScreenIndividualTest.kt:63)

So good news is that it does not seem to be related to our custom WearSnapshotHandler.
Bad news is that we still need to figure out what's causing it.

@luizgrp luizgrp changed the title NPE in WearSnapshotHandler during tests NPE in SnapshotVerifier during tests Jul 7, 2022
@luizgrp
Copy link
Member Author

luizgrp commented Jul 8, 2022

Potentially fixed by #350; it needs monitoring and this issue can be reopened.

@luizgrp luizgrp closed this as completed Jul 8, 2022
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

No branches or pull requests

1 participant