square / RxIdler

An IdlingResource for Espresso which wraps an RxJava Scheduler.
Apache License 2.0
512 stars 43 forks source link

Don't crash in stopWork if registerIdleTransitionCallback hasn't been called yet #28

Closed technoir42 closed 4 years ago

technoir42 commented 4 years ago

Fixes #20

technoir42 commented 4 years ago

@jrodbx can you take a look please

startthread commented 4 years ago

Can we please merge this PR? getting crash otherwise.

jdulaney commented 4 years ago

this PR fixed the issue for me; would be great to be merged in

JaimeToca commented 4 years ago

@technoir42 Fixed the issue for me too. It would be nice if this can be merged ...

jameswald commented 4 years ago

Does anyone know why registerIdleTransitionCallback(ResourceCallback) isn't being called before stopWork()? Or perhaps it is being called, but with a null argument?

technoir42 commented 4 years ago

@jameswald if you install DelegatingIdlingResourceScheduler but don't use Espresso in an instrumented test or run the app itself without instrumentation, stopWork will be called but registerIdleTransitionCallback won't and you'll get NPE.

Silencegod commented 4 years ago

Please merge this PR

lounah commented 4 years ago

PLEASE MERGE THIS ONE

Barboskin commented 4 years ago

Пацаны, давайте замержим уже please

technoir42 commented 4 years ago

@jrodbx is anyone still maintaining this library?

odlund commented 4 years ago

Just another comment asking to get this fix merged.

jrodbx commented 4 years ago

Debugged the underlying issue with @gamepro65 (thanks to @MerryMaryMaguire's detailed notes) and looks like this fix works, thanks for the contribution!

I filed https://github.com/android/android-test/issues/650 to raise awareness on the behavior change, in case of an unexpected regression in Espresso.