Join GitHub today
Don't fsync so often in tests #10516
This is a big speedup for some tests, e.g. OldIndexBackwardsCompatibilityTests goes from 159 sec (master) down to 49 sec on my dev box with this change:
In Lucene, when tests need to fsync, we only actually do it rarely. This used to be done in MockDirWrapper.sync, but was recently moved it down to MockFileSystem (DisableFsyncFS).
ES hasn't cutover to MockFS yet, so we are now always doing fsync in master...
I think we can do it rarely() like Lucene? I fixed ESMockDirectoryWrapper to do this ... but maybe instead we can cutover to MockFS?