1

I try to run unit tests on Gitlab CI and they fails few times in a row with the same exception

2019-05-30 07:11:41.820 ERROR 316 --- [           main] org.dbunit.database.DatabaseDataSet      : Table 'tbl_name' not found in tableMap=org.dbunit.dataset.OrderedTableNameMap[_tableNames=[], _tableMap={}, _caseSensitiveTableNames=false]
2019-05-30 07:11:41.821  WARN 316 --- [           main] o.s.test.context.TestContextManager      : Caught exception while invoking 'afterTestMethod' callback on TestExecutionListener [com.github.springtestdbunit.DbUnitTestExecutionListener@29ce22f] for test method [void TestClass.shouldThrowExceptionWhenCashAccountsReachItMaxNumber()] and test instance [TestClass@54af44db]

org.dbunit.dataset.NoSuchTableException: tbl_name
    at org.dbunit.database.DatabaseDataSet.getTableMetaData(DatabaseDataSet.java:305) ~[dbunit-2.6.0.jar:na]
    at org.dbunit.operation.DeleteAllOperation.execute(DeleteAllOperation.java:109) ~[dbunit-2.6.0.jar:na]
    at org.dbunit.operation.CompositeOperation.execute(CompositeOperation.java:79) ~[dbunit-2.6.0.jar:na]
    at com.github.springtestdbunit.DbUnitRunner.setupOrTeardown(DbUnitRunner.java:183) ~[spring-test-dbunit-1.3.0.jar:na]
    at com.github.springtestdbunit.DbUnitRunner.afterTestMethod(DbUnitRunner.java:92) ~[spring-test-dbunit-1.3.0.jar:na]
    at com.github.springtestdbunit.DbUnitTestExecutionListener.afterTestMethod(DbUnitTestExecutionListener.java:190) ~[spring-test-dbunit-1.3.0.jar:na]
    at org.springframework.test.context.TestContextManager.afterTestMethod(TestContextManager.java:443) ~[spring-test-5.1.5.RELEASE.jar:5.1.5.RELEASE]
    at org.springframework.test.context.junit.jupiter.SpringExtension.afterEach(SpringExtension.java:139) ~[spring-test-5.1.5.RELEASE.jar:5.1.5.RELEASE]
    at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.lambda$invokeAfterEachCallbacks$11(TestMethodTestDescriptor.java:218) ~[junit-jupiter-engine-5.3.2.jar:5.3.2]
    at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:72) ~[junit-platform-engine-1.3.2.jar:1.3.2]
    at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.lambda$invokeAllAfterMethodsOrCallbacks$13(TestMethodTestDescriptor.java:230) ~[junit-jupiter-engine-5.3.2.jar:5.3.2]
    at java.base/java.util.ArrayList.forEach(ArrayList.java:1540) ~[na:na]

this is .gitlab-ci.yaml

image: maven:3.6.0-jdk-11-slim

variables:
  MAVEN_OPTS: "-Dmaven.repo.local=/cache/.m2"

build:
  script: "mvn clean install -B"

my local configuration

C:\workspace>mvn -v
Apache Maven 3.6.1 (d66c9c0b3152b2e69ee9bac180bb8fcc8e6af555; 2019-04-04T22:00:29+03:00)
Maven home: C:\tools\apache-maven-3.6.1\bin\..
Java version: 11.0.2, vendor: Oracle Corporation, runtime: C:\Program Files\Java\jdk-11.0.2
Default locale: en_US, platform encoding: Cp1251
OS name: "windows 10", version: "10.0", arch: "amd64", family: "windows"

I try to run that docker image(maven:3.6.0-jdk-11-slim) locally and also tried version maven:3.6.1-jdk-11 but both had failed

Then I found that locally I have an Open JDK 11.0.2 while docker image use Open JDK 11.0.3 https://github.com/docker-library/openjdk/blob/1733ab9061cf1a076dc0566e40edb600fc434db4/11/jdk/slim/Dockerfile

maybe someone know what can be the problem?

Oleh Kurpiak
  • 1,339
  • 14
  • 34
  • The versions 11.0.2 and 11.0.3 *should* be backward compatible in case OpenJDK respects the semantic versioning. The patch version is used when you make backward-compatible bug fixes. Here is no problem. I'd rather focus on the error itself - did the unit tests passed before (in time... before an upgrade to higher Java version, etc.)? Is guaranteed that the table `tbl_name` really exists? – Nikolas Charalambidis May 30 '19 at 10:13
  • @Nikolas all tests are passed locally successfully, my team members also ran them locally with success, but when I run same tests on gitlab ci - they fails – Oleh Kurpiak May 30 '19 at 10:19
  • 1
    Is tbl_name related to your application? If so, can you post more of your application code. Mean while, can you check it this link? https://stackoverflow.com/questions/5066201/org-dbunit-dataset-nosuchtableexception-did-not-find-table-xxx-in-schema-nul – techtabu May 30 '19 at 14:45

0 Answers0