HDFS-8332 was purposefully reverted from branch-2 due to a compatibility concern. I'm surprised that this change would be required, and it might indicate that some aspect of the compatibility problem has crept back into branch-2.
I did some investigation and used git bisect to pin it down to
HDFS-8979. That's the first commit when the test started failing. That was supposed to be a Checkstyle cleanup, but perhaps a logic change got in there too. It's a big patch, so I'm still reviewing it.
Mingliang Liu, could you please take a look too?