The overflow handling code in TestResult is broken. It does not correctly compute the segment that should be shown after the overflow message, with the result that the .jtr file can grow unboundedly.
For example, see the sizes of these files:
$ wc -c build/jtreg/work/tools/javac/classfiles/attributes/annotations/*.jtr
3141554 build/jtreg/work/tools/javac/classfiles/attributes/annotations/RuntimeAnnotationsForGenericMethodTest.jtr
17815399 build/jtreg/work/tools/javac/classfiles/attributes/annotations/RuntimeAnnotationsForInnerAnnotationTest.jtr
44383298 build/jtreg/work/tools/javac/classfiles/attributes/annotations/RuntimeAnnotationsForInnerClassTest.jtr
43449160 build/jtreg/work/tools/javac/classfiles/attributes/annotations/RuntimeAnnotationsForInnerEnumTest.jtr
29426696 build/jtreg/work/tools/javac/classfiles/attributes/annotations/RuntimeAnnotationsForInnerInterfaceTest.jtr
39902534 build/jtreg/work/tools/javac/classfiles/attributes/annotations/RuntimeAnnotationsForTopLevelClassTest.jtr
2902884 build/jtreg/work/tools/javac/classfiles/attributes/annotations/RuntimeParameterAnnotationsForGenericMethodTest.jtr
22337944 build/jtreg/work/tools/javac/classfiles/attributes/annotations/RuntimeParameterAnnotationsTest.jtr
For example, see the sizes of these files:
$ wc -c build/jtreg/work/tools/javac/classfiles/attributes/annotations/*.jtr
3141554 build/jtreg/work/tools/javac/classfiles/attributes/annotations/RuntimeAnnotationsForGenericMethodTest.jtr
17815399 build/jtreg/work/tools/javac/classfiles/attributes/annotations/RuntimeAnnotationsForInnerAnnotationTest.jtr
44383298 build/jtreg/work/tools/javac/classfiles/attributes/annotations/RuntimeAnnotationsForInnerClassTest.jtr
43449160 build/jtreg/work/tools/javac/classfiles/attributes/annotations/RuntimeAnnotationsForInnerEnumTest.jtr
29426696 build/jtreg/work/tools/javac/classfiles/attributes/annotations/RuntimeAnnotationsForInnerInterfaceTest.jtr
39902534 build/jtreg/work/tools/javac/classfiles/attributes/annotations/RuntimeAnnotationsForTopLevelClassTest.jtr
2902884 build/jtreg/work/tools/javac/classfiles/attributes/annotations/RuntimeParameterAnnotationsForGenericMethodTest.jtr
22337944 build/jtreg/work/tools/javac/classfiles/attributes/annotations/RuntimeParameterAnnotationsTest.jtr