Issue #24402: Merge potential test fix from 3.5