Cherry-pick test for [Bug #20668]
The bug didn't impact master because this was largely refactored, but it's still valuable to add the test for it to prevent future regressions.
Cherry-pick test for [Bug #20668]
The bug didn't impact master because this was largely refactored,
but it's still valuable to add the test for it to prevent future
regressions.