The statistics system test sometimes needs a pause to wait for the expected stats to be reported. Also, the test for priming queries was ineffective; the result of the grep was not being checked.