lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Hoss Man (JIRA)" <>
Subject [jira] [Commented] (SOLR-11055) Add 'commitWithin' testing (of both soft/hard commits) to SoftAutoCommitTest
Date Wed, 12 Jul 2017 19:21:00 GMT


Hoss Man commented on SOLR-11055:

I have not tried this yet, but here's a rough outline/psuedo-code of what i think would make
sense for this...

* add some {{enum CommitWithinType ( HARD, SOFT, NONE )}}
* refactor all existing {{\*MaxTime\*}} based tests, so the meat of the tests are parameterized
by {{CommitWithinType}}, ala...{code}
public void testSoftAndHardCommitMaxTimeMixedAdds() throws Exception {
public void testSoftCommitWithinAndHardCommitMaxTimeMixedAdds() throws Exception {
public void testHardCommitWithinAndSoftCommitMaxTimeMixedAdds() throws Exception {
private void doTestSoftAndHardCommitMaxTimeMixedAdds(final CommitWithinType commitWithinType)
throws Exception {
* in the "meat" of these refactored methods...
** Do "something" to set the DUH2.commitWithinSoftCommit value
*** this might require refactoring the test to do initCore inside each method after setting
the sysprop
*** Or we add a new test only method to DUH2 to change this on the fly?
** change the tracker setup to only set tthe autoCommit times when they don't match the commitWithinType...{code}
    softTracker.setTimeUpperBound(commitWithinType.equals(SOFT) ? -1 : softCommitWaitMillis);
    hardTracker.setTimeUpperBound(commitWithinType.equals(HARD) ? -1 : hardCommitWaitMillis);
** init a new {{commitWithin}} var in the test via some helper method on the enum... {code}
// NONE returns -1
// HARD returns hardCommitWaitMillis
// SOFT returns softCommitWaitMillis
final long commitWithin = commitWithinType.useValue(softCommitWaitMillis, hardCommitWaitMillis);
** update all {{adoc(...)}} calls in the test to use the alternative version that takes in
* the existing polling and assertions based on {{hardCommitWaitMillis}} and {{softCommitWaitMillis}}
in all of these test methods should continue to work as expected -- regardless of wether the
commits are being triggered by the autoCommit timmer or the commitWithin timers

> Add 'commitWithin' testing (of both soft/hard commits) to SoftAutoCommitTest 
> -----------------------------------------------------------------------------
>                 Key: SOLR-11055
>                 URL:
>             Project: Solr
>          Issue Type: Sub-task
>      Security Level: Public(Default Security Level. Issues are Public) 
>            Reporter: Hoss Man
> SoftAutoCommitTest should be enhanced with it's monitor based polling to also check that
commitWithin works just as well as autocommit maxTime for either softCommit or hardCommit
(can't test both at the same time due to how commitWithin is configured)

This message was sent by Atlassian JIRA

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message