[
https://issues.apache.org/jira/browse/SOLR-11055?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16084534#comment-16084534
]
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 {
doTestSoftAndHardCommitMaxTimeMixedAdds(NONE);
}
public void testSoftCommitWithinAndHardCommitMaxTimeMixedAdds() throws
Exception {
doTestSoftAndHardCommitMaxTimeMixedAdds(SOFT);
}
public void testHardCommitWithinAndSoftCommitMaxTimeMixedAdds() throws
Exception {
doTestSoftAndHardCommitMaxTimeMixedAdds(HARD);
}
private void doTestSoftAndHardCommitMaxTimeMixedAdds(final CommitWithinType
commitWithinType) throws Exception {
...
}
{code}
* 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);
softTracker.setDocsUpperBound(-1);
hardTracker.setTimeUpperBound(commitWithinType.equals(HARD) ? -1 :
hardCommitWaitMillis);
hardTracker.setDocsUpperBound(-1);
{code}
** 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);
{code}
** update all {{adoc(...)}} calls in the test to use the alternative version
that takes in {{commitWithin}}
* 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: https://issues.apache.org/jira/browse/SOLR-11055
> 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
(v6.4.14#64029)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]