iipc / webarchive-commons

Common web archive utility code.
Apache License 2.0
49 stars 72 forks source link

Fix InterruptibleCharSequenceTest (testInterruptibility) to run on JDK 11 #91

Closed sebastian-nagel closed 3 years ago

sebastian-nagel commented 3 years ago

The unit test testInterruptibility is based on the assumption that after 500ms the matching thread is still running. Looks like JDK 11 has some performance improvements, so that running a thread and doing the matching takes less significantly less time. See commoncrawl/ia-web-commons#25.

Solution: if the thread running the regexp matching is already finished after the initial/current sleeping time, rerun the test with a shorter sleeping time until the expected RuntimeException is hit.