Skip to content

Conversation

@Wang-Benjamin
Copy link

Problem

The following tests in TestExampleBuilder.java are detected to be order-dependent and they may fail when the execution order of tests (in base module) is shuffled.

tk.mybatis.mapper.test.example.TestExampleBuilder.testBetween
tk.mybatis.mapper.test.example.TestExampleBuilder.testDistinct
tk.mybatis.mapper.test.example.TestExampleBuilder.testEqualTo
tk.mybatis.mapper.test.example.TestExampleBuilder.testExampleBuilder
tk.mybatis.mapper.test.example.TestExampleBuilder.testForUpdate
tk.mybatis.mapper.test.example.TestExampleBuilder.testIn
tk.mybatis.mapper.test.example.TestExampleBuilder.testMultiWhereCompound
tk.mybatis.mapper.test.example.TestExampleBuilder.testOrderBy
tk.mybatis.mapper.test.example.TestExampleBuilder.testWhereCompound0
tk.mybatis.mapper.test.example.TestExampleBuilder.testWhereCompound1
tk.mybatis.mapper.test.example.TestExampleBuilder.testWhereOrWhereCompound

Similar to the problem raised in #941, the above tests rely on a database that is original/unmodified. When some test runs before them and modifies some shared values in the database, these tests would fail because the database is polluted and properties of the database have changed.

Proposed Fix

Fix for these tests is the same as the mentioned PR. Resetting/Cleaning the database before executing tests in TestExampleBuilder enables the tests to access a database with unchanged properties. With this fix, these tests should pass whatever the execution order is.

(Detection tool is iDFlakies, please refer to https://github.com/UT-SE-Research/iDFlakies)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant