Test fix backport from 7e48c19ee159820ce42cfaf46c1a3ad57db773d7