SOLR-6273: Reset test hooks in a finally block to avoid leakage to other tests

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1693786 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Shalin Shekhar Mangar 2015-08-02 05:26:25 +00:00
parent 0e61da7531
commit 85347285f8
1 changed files with 49 additions and 44 deletions

View File

@ -432,7 +432,7 @@ public class CdcrUpdateLogTest extends SolrTestCaseJ4 {
@Test @Test
public void testClosingOutputStreamAfterLogReplay() throws Exception { public void testClosingOutputStreamAfterLogReplay() throws Exception {
this.clearCore(); this.clearCore();
try {
DirectUpdateHandler2.commitOnClose = false; DirectUpdateHandler2.commitOnClose = false;
final Semaphore logReplay = new Semaphore(0); final Semaphore logReplay = new Semaphore(0);
final Semaphore logReplayFinish = new Semaphore(0); final Semaphore logReplayFinish = new Semaphore(0);
@ -489,6 +489,11 @@ public class CdcrUpdateLogTest extends SolrTestCaseJ4 {
ulog.logs.peekLast().incref(); // reopen the output stream to check if its ends with a commit ulog.logs.peekLast().incref(); // reopen the output stream to check if its ends with a commit
assertTrue(ulog.logs.peekLast().endsWithCommit()); assertTrue(ulog.logs.peekLast().endsWithCommit());
ulog.logs.peekLast().decref(); ulog.logs.peekLast().decref();
} finally {
DirectUpdateHandler2.commitOnClose = true; // reset
UpdateLog.testing_logReplayHook = null;
UpdateLog.testing_logReplayFinishHook = null;
}
} }
/** /**