Backport of 9c19aff7c7561e3a82978a272ecdaad40dda5c00 from main.
Thanks to Tim for the review.
The issue was fixed on master in e9103402c0fa873aea58a6a11dba510cd308cb84 so this just forwardports the test and release notes from stable/1.7.x. Forwardport of 2d12a59938 from stable/1.7.x