Backport from 3.0 of a better test for #1208