WFLY-3519

Replaces #6403 with an additional commit that fixes the test failure.