Github user conniey commented on a diff in the pull request:
https://github.com/apache/lucenenet/pull/171#discussion_r62450860
--- Diff: src/Lucene.Net.Tests/core/Index/TestTransactions.cs ---
@@ -128,13 +134,21 @@ public IndexerThread(TestTransactions outerInstance,
object @lock, Directory dir
public override void DoWork()
{
- IndexWriter writer1 = new IndexWriter(Dir1,
((IndexWriterConfig)NewIndexWriterConfig(TEST_VERSION_CURRENT, new
MockAnalyzer(Random())).SetMaxBufferedDocs(3)).SetMergeScheduler(new
ConcurrentMergeScheduler()).SetMergePolicy(NewLogMergePolicy(2)));
-
((ConcurrentMergeScheduler)writer1.Config.MergeScheduler).SetSuppressExceptions();
+ var config = NewIndexWriterConfig(TEST_VERSION_CURRENT,
new MockAnalyzer(Random()))
+ .SetMaxBufferedDocs(3)
+ .SetMergeScheduler(_scheduler1)
+ .SetMergePolicy(NewLogMergePolicy(2));
+ IndexWriter writer1 = new IndexWriter(Dir1, config);
+
((IConcurrentMergeScheduler)writer1.Config.MergeScheduler).SetSuppressExceptions();
// Intentionally use different params so flush/merge
// happen @ different times
- IndexWriter writer2 = new IndexWriter(Dir2,
((IndexWriterConfig)NewIndexWriterConfig(TEST_VERSION_CURRENT, new
MockAnalyzer(Random())).SetMaxBufferedDocs(2)).SetMergeScheduler(new
ConcurrentMergeScheduler()).SetMergePolicy(NewLogMergePolicy(3)));
-
((ConcurrentMergeScheduler)writer2.Config.MergeScheduler).SetSuppressExceptions();
+ var config2 = NewIndexWriterConfig(TEST_VERSION_CURRENT,
new MockAnalyzer(Random()))
+ .SetMaxBufferedDocs(2)
+ .SetMergeScheduler(_scheduler2)
+ .SetMergePolicy(NewLogMergePolicy(3));
+ IndexWriter writer2 = new IndexWriter(Dir2, config2);
+
((IConcurrentMergeScheduler)writer2.Config.MergeScheduler).SetSuppressExceptions();
--- End diff --
I wanted to ensure that both schedulers were being tested so I can compare
in case there are bugs in the Task scheduler.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---