Author jeff.allen
Recipients jeff.allen
Date 2019-10-05.09:14:05
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
This is showing up intermittently in the CI on Java 11:

    [exec] test test_sort failed -- Traceback (most recent call last):
     [exec]   File "/home/travis/build/jythontools/jython/dist/Lib/test/", line 123, in testStressfully
     [exec]     s.sort()
     [exec]   File "/home/travis/build/jythontools/jython/dist/Lib/test/", line 123, in testStressfully
     [exec]     s.sort()
     [exec] IllegalArgumentException: java.lang.IllegalArgumentException: Comparison method violates its general contract!

I am raising the issue and will reference it in a skip as I don't want to divert from the beta release. We made an attempt to handle this by modifying the test, but it was not fully effective and I don't think we've understood it correctly. (I'll revert that.)

The test fails where we supply a pathological comparison function. I *think* all that is being tested is that in those cases, any error is handled and leaves the list unsorted. However, Java (in later versions) detects that the comparator is badly behaved and raises its own error that is not handled.

See #2399 (and which goes a long way towards solving a related problem in the context of test_list by storing the exception and rethrowing it. An extension to (certain) Java exceptions may be what we need. But also, what about proxied Java lists doing the same?

I don't find the test to be well-designed: it tests too many things at once and I got confused reading it. OTOH it comes to us from CPython and it's nice to use the same source.
Date User Action Args
2019-10-05 09:14:05jeff.allensetrecipients: + jeff.allen
2019-10-05 09:14:05jeff.allensetmessageid: <>
2019-10-05 09:14:05jeff.allenlinkissue2812 messages
2019-10-05 09:14:05jeff.allencreate