mysql-binlog-connector-java icon indicating copy to clipboard operation
mysql-binlog-connector-java copied to clipboard

The tests in BinaryLogClientIntegrationTest are being run twice

Open jinfwhuang opened this issue 6 years ago • 0 comments

The tests in BinaryLogClientIntegrationTest are being run twice because BinaryLogClientGTIDIntegrationTest inherits BinaryLogClientIntegrationTest.

Furthermore, some tests could fail due to parallel execution. This failure is flaky Below is one examples.

Example 1:

setUp(com.github.shyiko.mysql.binlog.BinaryLogClientIntegrationTest)  Time elapsed: 3.267 sec  <<< FAILURE!
java.util.concurrent.TimeoutException: Received 3 QUERY event(s) instead of expected 2
        at com.github.shyiko.mysql.binlog.CountDownEventListener.waitForCounterToGetZero(CountDownEventListener.java:82)
        at com.github.shyiko.mysql.binlog.CountDownEventListener.waitFor(CountDownEventListener.java:65)
        at com.github.shyiko.mysql.binlog.BinaryLogClientIntegrationTest.setUp(BinaryLogClientIntegrationTest.java:144)


Results :

Failed tests:
  BinaryLogClientIntegrationTest.setUp:144 » Timeout Received 3 QUERY event(s) i...

Example 2:

Tests run: 122, Failures: 1, Errors: 0, Skipped: 1, Time elapsed: 24.95 sec <<< FAILURE! - in TestSuite
testMySQL8TableMetadata(com.github.shyiko.mysql.binlog.BinaryLogClientGTIDIntegrationTest)  Time elapsed: 0.008 sec  <<< FAILURE!
java.sql.SQLSyntaxErrorException: Table 'test_metameta' already exists
        at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:120)
        at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:97)
        at com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException(SQLExceptionsMapping.java:122)
        at com.mysql.cj.jdbc.StatementImpl.executeInternal(StatementImpl.java:782)
        at com.mysql.cj.jdbc.StatementImpl.execute(StatementImpl.java:666)
        at com.github.shyiko.mysql.binlog.BinaryLogClientIntegrationTest$MySQLConnection$2.execute(BinaryLogClientIntegrationTest.java:1125)
        at com.github.shyiko.mysql.binlog.BinaryLogClientIntegrationTest$MySQLConnection$2.execute(BinaryLogClientIntegrationTest.java:1121)
        at com.github.shyiko.mysql.binlog.BinaryLogClientIntegrationTest$MySQLConnection.execute(BinaryLogClientIntegrationTest.java:1107)
        at com.github.shyiko.mysql.binlog.BinaryLogClientIntegrationTest$MySQLConnection.execute(BinaryLogClientIntegrationTest.java:1117)
        at com.github.shyiko.mysql.binlog.BinaryLogClientIntegrationTest$MySQLConnection.execute(BinaryLogClientIntegrationTest.java:1121)
        at com.github.shyiko.mysql.binlog.BinaryLogClientIntegrationTest.testMySQL8TableMetadata(BinaryLogClientIntegrationTest.java:997)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:84)
        at org.testng.internal.Invoker.invokeMethod(Invoker.java:714)
        at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:901)
        at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1231)
        at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:127)
        at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:111)
        at org.testng.TestRunner.privateRun(TestRunner.java:767)
        at org.testng.TestRunner.run(TestRunner.java:617)
        at org.testng.SuiteRunner.runTest(SuiteRunner.java:334)
        at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:329)
        at org.testng.SuiteRunner.privateRun(SuiteRunner.java:291)
        at org.testng.SuiteRunner.run(SuiteRunner.java:240)
        at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
        at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86)
        at org.testng.TestNG.runSuitesSequentially(TestNG.java:1224)
        at org.testng.TestNG.runSuitesLocally(TestNG.java:1149)
        at org.testng.TestNG.run(TestNG.java:1057)
        at org.apache.maven.surefire.testng.TestNGExecutor.run(TestNGExecutor.java:69)
        at org.apache.maven.surefire.testng.TestNGDirectoryTestSuite.executeMulti(TestNGDirectoryTestSuite.java:181)
        at org.apache.maven.surefire.testng.TestNGDirectoryTestSuite.execute(TestNGDirectoryTestSuite.java:99)
        at org.apache.maven.surefire.testng.TestNGProvider.invoke(TestNGProvider.java:113)
        at org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:200)
        at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:153)
        at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:103)


Results :

Failed tests:
  BinaryLogClientGTIDIntegrationTest>BinaryLogClientIntegrationTest.testMySQL8TableMetadata:997 » SQLSyntaxError

jinfwhuang avatar May 31 '19 21:05 jinfwhuang