Skip to content

Commit 47015c8

Browse files
Claude4.0oclaude
andcommitted
Fix flaky IOUtilitiesProtocolValidationTest performance test
- Add warmup iterations for JIT compilation before timing - Increase threshold from 100ms to 500ms for CI environments Co-Authored-By: Claude Opus 4 <noreply@anthropic.com>
1 parent fdce62a commit 47015c8

2 files changed

Lines changed: 14 additions & 3 deletions

File tree

changelog.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
### Revision History
22

3+
#### 4.91.0 (unreleased)
4+
* **MAINTENANCE**: Fixed flaky `IOUtilitiesProtocolValidationTest.testProtocolValidationPerformance` test
5+
* Added warmup iterations to allow JIT compilation before timing
6+
* Increased threshold from 100ms to 500ms for CI environments with variable performance
7+
38
#### 4.90.0 2026-02-02
49
* **BUG FIX**: `DeepEquals` - URL comparison now uses string representation instead of `URL.equals()`
510
* Java's `URL.equals()` performs DNS resolution which causes flaky CI failures

src/test/java/com/cedarsoftware/util/IOUtilitiesProtocolValidationTest.java

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -344,14 +344,20 @@ public void testProtocolValidationPerformance() throws Exception {
344344
// Test that protocol validation doesn't significantly impact performance
345345
URL url = new URL("https://example.com");
346346
URLConnection connection = url.openConnection();
347-
347+
348+
// Warmup iterations to allow JIT compilation
349+
for (int i = 0; i < 100; i++) {
350+
validateUrlProtocolMethod.invoke(null, connection);
351+
}
352+
348353
long startTime = System.nanoTime();
349354
for (int i = 0; i < 1000; i++) {
350355
validateUrlProtocolMethod.invoke(null, connection);
351356
}
352357
long endTime = System.nanoTime();
353-
358+
354359
long durationMs = (endTime - startTime) / 1_000_000;
355-
assertTrue(durationMs < 100, "Protocol validation should be fast (took " + durationMs + "ms for 1000 calls)");
360+
// Use generous threshold for CI environments with variable performance
361+
assertTrue(durationMs < 500, "Protocol validation should be fast (took " + durationMs + "ms for 1000 calls)");
356362
}
357363
}

0 commit comments

Comments
 (0)