Description
testpoints used to only be emitted by assertions (still sketchy), but now are emitted always. I assume this is due to the change to support running tests with assertions disabled.
we should try to clean this up, simple stuff like this is now useless:
indexWriterConfig.setInfoStream(System.out); // causes massive flooding like this: // TP 0 [Tue Dec 16 20:19:37 EST 2014; Thread-0]: DocumentsWriterPerThread addDocument start // TP 0 [Tue Dec 16 20:19:37 EST 2014; Thread-0]: DocumentsWriterPerThread addDocument start // TP 0 [Tue Dec 16 20:19:37 EST 2014; Thread-0]: DocumentsWriterPerThread addDocument start
I hit this several times today just trying to do benchmarks and debugging.
Here is a patch.
This adds a package private boolean 'enableTestPoints' to IndexWriter. We don't base it on assertion status or any of that, you only want test points if you are one of the few special tests asking for them.
I refactored all tests to use the RandomIndexWriter.mockIndexWriter for registering listeners at test points, and this sets the necessary boolean for you on IW.
I also added simple tests ensuring that test points are only output when we ask for them.