Fix a sometimes-failing test