Make sure that chainparams and logging is properly initialized. Doing this for every test may be overkill, but this initialization is so simple that that does not matter. This should fix the travis issues.
Now that we no longer use the median filter to keep track of the number of blocks of peers, that's the only place it is used.