java.lang.AssertionError: Command: /retain editor |, output: [C:\\, D:\\, E:\\, G:\\]: lists don't have the same size expected [5] but found [4]

JDK Bug System | Steve Sides | 3 months ago
  1. 0

    langtools\test\jdk\jshell\CommandCompletionTest.java fails on some windows machines. The 'retain editor |' test fails to pick up a dvd drive. A slightly edited ReplToolTesting.jjava shows the output below. This is from running the test on windows7 command line on a machine with a dvd rw, with simple jtreg call: sh jtreg -jdk:d:\jdk\9u135 -dir:d:\ws\b1082\langtools\test jdk/jshell/CommandCompletionTest.java Full jtr files (edited output and as is in openjdk) are attached. [DEBUG] assertCompletion(/retain editor |, false, [Ljava.lang.String;@1994520 [DEBUG] completion:C:\\ [DEBUG] completion:D:\\ [DEBUG] completion:E:\\ [DEBUG] completion:G:\\ [DEBUG] expected:C:\\ [DEBUG] expected:D:\\ [DEBUG] expected:E:\\ [DEBUG] expected:F:\\ [DEBUG] expected:G:\\ test CommandCompletionTest.testRetain(): failure java.lang.AssertionError: Command: /retain editor |, output: [C:\\, D:\\, E:\\, G:\\]: lists don't have the same size expected [5] but found [4] at org.testng.Assert.fail(Assert.java:94) at org.testng.Assert.failNotEquals(Assert.java:496) at org.testng.Assert.assertEquals(Assert.java:125) at org.testng.Assert.assertEquals(Assert.java:372) at org.testng.Assert.assertEquals(Assert.java:539) at ReplToolTesting.assertCompletion(ReplToolTesting.java:464) at ReplToolTesting.assertCompletion(ReplToolTesting.java:453) at CommandCompletionTest.lambda$testRetain$49(CommandCompletionTest.java:209) at ReplToolTesting$PromptedCommandOutputStream.write(ReplToolTesting.java:770) at ReplToolTesting$PromptedCommandOutputStream.write(ReplToolTesting.java:786) at java.io.PrintStream.write(java.base@9-ea/PrintStream.java:480) at sun.nio.cs.StreamEncoder.writeBytes(java.base@9-ea/StreamEncoder.java:233) at sun.nio.cs.StreamEncoder.implFlushBuffer(java.base@9-ea/StreamEncoder.java:312) at sun.nio.cs.StreamEncoder.implFlush(java.base@9-ea/StreamEncoder.java:316) at sun.nio.cs.StreamEncoder.flush(java.base@9-ea/StreamEncoder.java:153) at java.io.OutputStreamWriter.flush(java.base@9-ea/OutputStreamWriter.java:256) at jdk.internal.jline.console.ConsoleReader.readLine(jdk.internal.le@9-ea/ConsoleReader.java:2337) at jdk.internal.jline.console.ConsoleReader.readLine(jdk.internal.le@9-ea/ConsoleReader.java:2278) at jdk.internal.jshell.tool.ConsoleIOContext.readLine(jdk.jshell@9-ea/ConsoleIOContext.java:179) at jdk.internal.jshell.tool.JShellTool.run(jdk.jshell@9-ea/JShellTool.java:790) at jdk.internal.jshell.tool.JShellTool.start(jdk.jshell@9-ea/JShellTool.java:538) at jdk.internal.jshell.tool.JShellTool.start(jdk.jshell@9-ea/JShellTool.java:491) at ReplToolTesting.testRaw(ReplToolTesting.java:256) at ReplToolTesting.test(ReplToolTesting.java:213) at ReplToolTesting.test(ReplToolTesting.java:201) at CommandCompletionTest.testRetain(CommandCompletionTest.java:203) at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(java.base@9-ea/Native Method) at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(java.base@9-ea/NativeMethodAccessorImpl.java:62) at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(java.base@9-ea/DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(java.base@9-ea/Method.java:535) at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:85) at org.testng.internal.Invoker.invokeMethod(Invoker.java:639) at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:821) at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1131) at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:124) at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:108) at org.testng.TestRunner.privateRun(TestRunner.java:773) at org.testng.TestRunner.run(TestRunner.java:623) at org.testng.SuiteRunner.runTest(SuiteRunner.java:357) at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:352) at org.testng.SuiteRunner.privateRun(SuiteRunner.java:310) at org.testng.SuiteRunner.run(SuiteRunner.java:259) at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52) at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86) at org.testng.TestNG.runSuitesSequentially(TestNG.java:1185) at org.testng.TestNG.runSuitesLocally(TestNG.java:1110) at org.testng.TestNG.run(TestNG.java:1018) at com.sun.javatest.regtest.TestNGAction$TestNGRunner.main(TestNGAction.java:220) at com.sun.javatest.regtest.TestNGAction$TestNGRunner.main(TestNGAction.java:184) at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(java.base@9-ea/Native Method) at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(java.base@9-ea/NativeMethodAccessorImpl.java:62) at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(java.base@9-ea/DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(java.base@9-ea/Method.java:535) at com.sun.javatest.regtest.agent.MainWrapper$MainThread.run(MainWrapper.java:110) at java.lang.Thread.run(java.base@9-ea/Thread.java:843) This is from running the test on windows7 command line on a machine with a dvd rw. sh jtreg -jdk:d:\jdk\9u135 -dir:d:\ws\b1082\langtools\test jdk/jshell/CommandCompletionTest.java

    JDK Bug System | 3 months ago | Steve Sides
    java.lang.AssertionError: Command: /retain editor |, output: [C:\\, D:\\, E:\\, G:\\]: lists don't have the same size expected [5] but found [4]
  2. 0

    Test fails on jdk9 b132. config CompletionSuggestionTest.setUp(): success test CompletionSuggestionTest.testUncompletedDeclaration(): failure java.lang.AssertionError: Input: class Clazz { Clazz clazz; Object o = cla|, [class_path_test, clazz]: lists don't have the same size expected [1] but found [2] at org.testng.Assert.fail(Assert.java:94) at org.testng.Assert.failNotEquals(Assert.java:496) at org.testng.Assert.assertEquals(Assert.java:125) at org.testng.Assert.assertEquals(Assert.java:372) at org.testng.Assert.assertEquals(Assert.java:539) at KullaTesting.assertCompletion(KullaTesting.java:861) at KullaTesting.assertCompletion(KullaTesting.java:856) at CompletionSuggestionTest.testUncompletedDeclaration(CompletionSuggestionTest.java:422) at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(java.base@9-ea/Native Method) at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(java.base@9-ea/NativeMethodAccessorImpl.java:62) at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(java.base@9-ea/DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(java.base@9-ea/Method.java:535) at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:85) at org.testng.internal.Invoker.invokeMethod(Invoker.java:639) at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:821) at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1131) at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:124) at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:108) at org.testng.TestRunner.privateRun(TestRunner.java:773) at org.testng.TestRunner.run(TestRunner.java:623) at org.testng.SuiteRunner.runTest(SuiteRunner.java:357) at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:352) at org.testng.SuiteRunner.privateRun(SuiteRunner.java:310) at org.testng.SuiteRunner.run(SuiteRunner.java:259) at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52) at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86) at org.testng.TestNG.runSuitesSequentially(TestNG.java:1185) at org.testng.TestNG.runSuitesLocally(TestNG.java:1110) at org.testng.TestNG.run(TestNG.java:1018) at com.sun.javatest.regtest.TestNGAction$TestNGRunner.main(TestNGAction.java:220) at com.sun.javatest.regtest.TestNGAction$TestNGRunner.main(TestNGAction.java:184) at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(java.base@9-ea/Native Method) at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(java.base@9-ea/NativeMethodAccessorImpl.java:62) at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(java.base@9-ea/DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(java.base@9-ea/Method.java:535) at com.sun.javatest.regtest.agent.MainWrapper$MainThread.run(MainWrapper.java:110) at java.lang.Thread.run(java.base@9-ea/Thread.java:843)

    JDK Bug System | 3 months ago | Andrey Nazarov
    java.lang.AssertionError: Input: class Clazz { Clazz clazz; Object o = cla|, [class_path_test, clazz]: lists don't have the same size expected [1] but found [2]
  3. 0

    assertEquals(Collection, Collection) prints "null" when collections are different sizes

    GitHub | 3 years ago | dimo414
    java.lang.AssertionError: null: lists don't have the same size expected [1] but found [0]
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    must be(expected_value) test failed messages are confusing

    GitHub | 4 years ago | epishkin
    java.lang.AssertionError: expected:<expected value> but was:<null>
  6. 0

    Build fails using JDK 8

    GitHub | 2 years ago | paulf
    java.lang.AssertionError: expected:<b=d&c=f&a=b> but was:<a=b&b=d&c=f>

    5 unregistered visitors
    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. java.lang.AssertionError

      Command: /retain editor |, output: [C:\\, D:\\, E:\\, G:\\]: lists don't have the same size expected [5] but found [4]

      at org.testng.Assert.fail()
    2. TestNG
      Assert.assertEquals
      1. org.testng.Assert.fail(Assert.java:94)
      2. org.testng.Assert.failNotEquals(Assert.java:496)
      3. org.testng.Assert.assertEquals(Assert.java:125)
      4. org.testng.Assert.assertEquals(Assert.java:372)
      5. org.testng.Assert.assertEquals(Assert.java:539)
      5 frames
    3. Unknown
      ReplToolTesting$PromptedCommandOutputStream.write
      1. ReplToolTesting.assertCompletion(ReplToolTesting.java:464)
      2. ReplToolTesting.assertCompletion(ReplToolTesting.java:453)
      3. CommandCompletionTest.lambda$testRetain$49(CommandCompletionTest.java:209)
      4. ReplToolTesting$PromptedCommandOutputStream.write(ReplToolTesting.java:770)
      5. ReplToolTesting$PromptedCommandOutputStream.write(ReplToolTesting.java:786)
      5 frames