Skip to content

Commit

Permalink
Attempt to fix windows test failures
Browse files Browse the repository at this point in the history
  • Loading branch information
pmconrad committed Aug 15, 2023
1 parent da2e35f commit ab7d880
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions test/com/sun/jna/CallbacksTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -375,10 +375,10 @@ public void callback() {
for (int i = 0; i < Cleaner.MASTER_CLEANUP_INTERVAL_MS / 10 + 5 && (cbstruct.peer != 0 || refs.size() > 0); ++i) {
// Flush weak hash map
refs.size();
try {
Thread.sleep(Cleaner.MASTER_CLEANUP_INTERVAL_MS + 10); // Give the GC a chance to run
Thread.sleep(10); // Give the GC a chance to run
synchronized (CallbacksTest.class) { // the cbstruct.peer cleanup happens in a different thread, make sure we see it here
System.gc();
} finally {}
}
}
assertEquals("Callback trampoline not freed", 0, cbstruct.peer);
}
Expand Down

0 comments on commit ab7d880

Please sign in to comment.