fix test cases under 5.18

This seems to fix RT#87218.