brianfrankcooper / YCSB

Yahoo! Cloud Serving Benchmark
Apache License 2.0
4.86k stars 2.22k forks source link

Fixed non-idempotent unit tests in `AsyncHBaseTest` and `HBaseClient1Test` #1705

Open kaiyaok2 opened 3 months ago

kaiyaok2 commented 3 months ago

Motivation:

Tests in the AsyncHBaseTest and HBaseClient1Test are not idempotent and fail in repeated runs, because they pollute a state reused by themselves. Take AsyncHBaseTest as an example - the tests used the shared AsyncHBaseClient instance client to perform operations including read() and insert(). However, client is not cleaned up after the tests, so the repeated runs fail. Fixing non-idempotent tests can help proactively avoid state pollution that results in test order dependency (which could then hurt regression testing under test selection / prioritization / parallelization).

The list of non-idempotent tests are:

Reproduce

Reproduce:

Using the NIOInspector plugin that supports rerunning JUnit tests in the same environment. Use HBaseClient1Test as an example:

cd hbase1
mvn edu.illinois:NIOInspector:rerun -Dtest=site.ycsb.db.hbase1.HBaseClient1Test

Error messages for the failed tests in the second run:

kaiyaok2 commented 2 months ago

@busbey @joshelser Please review