db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mike matrigali <mikema...@gmail.com>
Subject Re: question about the Store unit tests
Date Fri, 09 Aug 2013 17:34:39 GMT
I don't know much, only guesses.  Often testing recovery after a 
recovery is a different code path than the original recovery.
The original recovery will write a bunch of compensating log records,
so doing the same operation again actually does something different
the second time as it has to work through the compensating log

These tests want to very carefully control the layout of the record
in the log file which is why they were done as unit test rather
than standard sql tests.  In the second case they go in and hand
corrupt a page to force the checksum logic.

These tests are kind of subtle as what is being tested is not really
visible in the code in the tests.  The most important code paths being
tested are the startup recovery code paths taken when each of the
tests recovers from the hard crash simulated by exiting the previous
test by simply exiting.

Unfortunately I see no comments about this.  And as you point out the
comments in the actual test look wrong.  Likely the comments should
just have the "2" test added.

Note that the second comment has -DTestBadLogSetup=true set and these
tests are run by the following, and it seems like from comments
Log1 should be run
again but I don't know if comment is wrong or test run:

Overall it is worth noting that just normal crash recovery testing is 
woefully small, as it was hard to write.  Recently support was added to 
testing to make it easy to write as standard junit testing.

On 8/9/2013 6:04 AM, Rick Hillegas wrote:
> Does anyone know why the following tests occur twice in the
> storeunit.runall suite, which runs on the old test harness?
> unit/recoverBadLog1.unit
> unit/recoverBadLog2.unit
> I believe that these unit tests live in T_RecoverBadLog.java. The header
> comment in that file shows recoverBadLog1 being run twice, but not
> recoverBadLog2. What is the reason to run these tests twice and why does
> the header comment in T_RecoverBadLog disagree with the contents of
> storeunit.runall?
> Thanks,
> -Rick

View raw message