Cherry picked test fix from master