TestNG using junit mode does not seem to work

I’m trying to run my integration tests with gradle (4.10.3) testng with the following setup:
a testng suite with junit=true
a junit test class with a @ClassRule and @Rule (wrappers)

With that my gradle build reports as a SUCCESS, even though internally gradle testng infrastructure fails at assertion: https://github.com/gradle/gradle/blob/v4.10.3/subprojects/testing-jvm/src/main/java/org/gradle/api/internal/tasks/testing/testng/TestNGTestResultProcessorAdapter.java#L168

Which basically says parentId was not set (as expected in https://github.com/gradle/gradle/blob/v4.10.3/subprojects/testing-jvm/src/main/java/org/gradle/api/internal/tasks/testing/testng/TestNGTestResultProcessorAdapter.java#L136), so I dug deeper and it turns out the reason for this is that iTestContext.getAllTestMethods() needs to set the parent returns empty array for my test class.

The reason this array is not set (by testng) is because testng code says this:

// Init methods and class map
// JUnit behavior is different and doesn’t need this initialization step
if(!m_xmlTest.isJUnit()) {

Am I doing something wrong?
It looks like a bug to me but 'm not allowed to post it to the Bugs section.

You are not alone. I’m getting the same error with gradle-5.2.1 and testImplementation ‘org.testng:testng:6.14.3’. I’m investigating further. Did you get by this?