diff --git a/lucene/test-framework/src/java/org/apache/lucene/store/MockIndexOutputWrapper.java b/lucene/test-framework/src/java/org/apache/lucene/store/MockIndexOutputWrapper.java index e5d61e0b724..0989d9e4977 100644 --- a/lucene/test-framework/src/java/org/apache/lucene/store/MockIndexOutputWrapper.java +++ b/lucene/test-framework/src/java/org/apache/lucene/store/MockIndexOutputWrapper.java @@ -55,14 +55,14 @@ public class MockIndexOutputWrapper extends IndexOutput { long realUsage = 0; // Enforce disk full: - if (dir.maxSize != 0 && freeSpace < len) { + if (dir.maxSize != 0 && freeSpace <= len) { // Compute the real disk free. This will greatly slow // down our test but makes it more accurate: realUsage = dir.getRecomputedActualSizeInBytes(); freeSpace = dir.maxSize - realUsage; } - if (dir.maxSize != 0 && freeSpace < len) { + if (dir.maxSize != 0 && freeSpace <= len) { if (freeSpace > 0) { realUsage += freeSpace; if (b != null) {