Skip to content

Commit

Permalink
Debug progress emission count
Browse files Browse the repository at this point in the history
(Failing in CI on Windows JDK 21 only)
  • Loading branch information
jhy committed Aug 8, 2024
1 parent 92104bf commit 6806255
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/test/java/org/jsoup/integration/ConnectTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -1006,8 +1006,14 @@ void progressListener(String path) throws IOException {

// should expect to see events relative to how large the buffer is.
int expected = LargeDocFileLen / 8192;
assertTrue(numProgress.get() > expected * 0.75);
assertTrue(numProgress.get() < expected * 1.25);

int num = numProgress.get();
// debug log if not in those ranges:
if (num < expected * 0.75 || num > expected * 1.25) {
System.err.println("Expected: " + expected + ", got: " + num);
}
assertTrue(num > expected * 0.75);
assertTrue(num < expected * 1.25);

// check the document works
assertEquals(LargeDocTextLen, document.text().length());
Expand Down

0 comments on commit 6806255

Please sign in to comment.