fix intermittent bug in test