Fix test cancel query