the-blue-alliance / the-blue-alliance-android

An Android app for accessing information about the FIRST Robotics Competition.
MIT License
76 stars 34 forks source link

Don't initialize Firebase for tests #920

Open bherbst opened 5 years ago

bherbst commented 5 years ago

One somewhat common source of test flakiness that I have observed is Firebase failing to initialize in our unit test, usually with a message like this:

java.util.concurrent.RejectedExecutionException: Task java.util.concurrent.FutureTask@3a918bde[Not completed, task = java.util.concurrent.Executors$RunnableAdapter@2975e4ef[Wrapped task = com.google.android.gms.internal.crash.zzf@46f1dde8]] rejected from java.util.concurrent.ThreadPoolExecutor@a5db1dd[Terminated, pool size = 0, active threads = 0, queued tasks = 0, completed tasks = 1]

Really, we shouldn't be initializing Firebase and using it in our tests anyway.

The vast majority of this dependency comes from our TbaLogger, which logs everything to Firebase. My proposal is that we switch to Timber and use a different Tree for tests that doesn't report to Firebase.