By the way, the reason this doesnt fail always but only for certain codecs:
some codecs have assertions that get tripped, so they fail the test.
other codecs don't have these asserts, so they pass the test, and checkindex happens to pass.
but this is only because checkindex ignores deleted docs in testPostings, the index really is corrumpt in those cases!
attached is a new test demonstrating this: for some codecs it triggers an assert, for others it makes a corrumpt index. I havent tested this yet on 3.x but i suspect it fails!