JDK-8265918 : java/io/Console/CharsetTest.java failed with "expect: spawn id exp6 not open"
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.io
  • Affected Version: 17
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • OS: linux_ubuntu
  • CPU: x86_64
  • Submitted: 2021-04-25
  • Updated: 2021-05-07
  • Resolved: 2021-04-29
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 17
17 b21Fixed
Related Reports
Relates :  
Description
The following test failed in the JDK17 CI:

java/io/Console/CharsetTest.java

Here's a snippet from the log file:

----------System.err:(24/1939)----------
 stdout: [spawn /opt/mach5/mesos/work_dir/jib-master/install/jdk-17+20-1677/linux-x64.jdk/jdk-17/bin/java -Dsun.stdout.encoding=ISO8859-1 -classpath /opt/mach5/mesos/work_dir/slaves/a4f8fba9-f017-4328-b286-c66b6a97143d-S2209/frameworks/1735e8a2-a1db-478c-8104-60c8b0af87dd-0196/executors/e2c001ef-348a-4b98-8f55-648a35660152/runs/4d842d4b-1647-4980-bd0e-e1f4f84ef946/testoutput/test-support/jtreg_open_test_jdk_tier2_part2/classes/3/java/io/Console/CharsetTest.d CharsetTest
ISO-8859-1
spawn env LANG=en_US.ISO8859-1 LC_ALL=en_US.ISO8859-1 /opt/mach5/mesos/work_dir/jib-master/install/jdk-17+20-1677/linux-x64.jdk/jdk-17/bin/java -classpath /opt/mach5/mesos/work_dir/slaves/a4f8fba9-f017-4328-b286-c66b6a97143d-S2209/frameworks/1735e8a2-a1db-478c-8104-60c8b0af87dd-0196/executors/e2c001ef-348a-4b98-8f55-648a35660152/runs/4d842d4b-1647-4980-bd0e-e1f4f84ef946/testoutput/test-support/jtreg_open_test_jdk_tier2_part2/classes/3/java/io/Console/CharsetTest.d CharsetTest
US-ASCII
];
 stderr: [expect: spawn id exp6 not open
    while executing
"expect eof"
    (file "/opt/mach5/mesos/work_dir/jib-master/install/jdk-17+20-1677/src.full/open/test/jdk/java/io/Console/script.exp" line 42)
]
 exitValue = 1

java.lang.RuntimeException: Test failed. Exit value from 'expect' command: 1
	at CharsetTest.main(CharsetTest.java:73)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:78)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:568)
	at com.sun.javatest.regtest.agent.MainActionHelper$AgentVMRunnable.run(MainActionHelper.java:298)
	at java.base/java.lang.Thread.run(Thread.java:831)

JavaTest Message: Test threw exception: java.lang.RuntimeException
JavaTest Message: shutting down test

----------System.out:(8/640)----------
[2021-04-25T04:04:44.001433669Z] Gathering output for process 2631585
[2021-04-25T04:04:44.158965879Z] Waiting for completion for process 2631585
[2021-04-25T04:04:44.159064063Z] Waiting for completion finished for process 2631585
Output and diagnostic info for process 2631585 was saved into 'pid-2631585-output.log'
[2021-04-25T04:04:44.160455455Z] Waiting for completion for process 2631585
[2021-04-25T04:04:44.160513784Z] Waiting for completion finished for process 2631585
[2021-04-25T04:04:44.164728516Z] Waiting for completion for process 2631585
[2021-04-25T04:04:44.164818525Z] Waiting for completion finished for process 2631585
result: Failed. Execution failed: `main' threw exception: java.lang.RuntimeException: Test failed. Exit value from 'expect' command: 1
Comments
Changeset: 294347b5 Author: Naoto Sato <naoto@openjdk.org> Date: 2021-04-29 13:01:30 +0000 URL: https://git.openjdk.java.net/jdk/commit/294347b59be684ee398b442a1c64824eb03311dc
29-04-2021

Since we cannot distinguish the linux flavor underneath, let alone supported locales/encodings, possibly the fix is to shrink the test cases down to ones that are presumed to succeed. This way, it won't cause any machine-dependent test run failure, which is an annoying noise.
27-04-2021

The reason for the failure seems that the machine does not equip with en_US.ISO8859-1 locale. Thus setting the environment variables (LANG & LC_ALL) fails and falls back to US-ASCII encoding.
26-04-2021