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:
AsyncHBaseTest#testScan
AsyncHBaseTest#testRead
AsyncHBaseTest#testReadMissingRow
AsyncHBaseTest#testUpdate
HBaseClient1Test#testScan
HBaseClient1Test#testRead
HBaseClient1Test#testReadMissingRow
HBaseClient1Test#testUpdate
HBaseClient2Test#testScan
HBaseClient2Test#testRead
HBaseClient2Test#testReadMissingRow
HBaseClient2Test#testUpdate
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:
testScan():
java.lang.AssertionError: expected:<5> but was:<0>
testReadMissingRow():
java.lang.AssertionError: expected:<Status [name=NOT_FOUND, description=The requested record was not found.]> but was:<Status [name=ERROR, description=The operation failed.]>
Motivation:
Tests in the
AsyncHBaseTest
andHBaseClient1Test
are not idempotent and fail in repeated runs, because they pollute a state reused by themselves. TakeAsyncHBaseTest
as an example - the tests used the sharedAsyncHBaseClient
instanceclient
to perform operations includingread()
andinsert()
. 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. UseHBaseClient1Test
as an example:Error messages for the failed tests in the second run:
testScan()
:testReadMissingRow()
:testRead()
:testUpdate()
:Proposed Fix
Clean up
client
in the tear down function.