jruby: mri-extra - flaky TestOpen3 pipe tests
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
java-common (Ubuntu) |
Fix Released
|
Undecided
|
Unassigned | ||
jruby (Debian) |
New
|
Unknown
|
|||
jruby (Ubuntu) |
New
|
Undecided
|
Unassigned | ||
openjdk-21 (Ubuntu) |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
The autopkgtests for jruby fail `mri-extra` with the following errors:
1) Failure:
TestOpen3#
Failed assertion, no message given.
2) Failure:
TestOpen3#
<true> expected but was
<false>.
3) Failure:
TestOpen3#
The minimal reproducer of those:
----
require 'open3'
RUBY = 'jruby'
Open3.pipeline_
print(o.read)
}
---
executing the above sample results in the following output:
# jruby test.rb
12# jruby test.rb
12# jruby test.rb
12# jruby test.rb
12# jruby test.rb
2# jruby test.rb
12# jruby test.rb
2# jruby test.rb
12# jruby test.rb
2# jruby test.rb
2# jruby test.rb
2# jruby test.rb
2# jruby test.rb
12# jruby test.rb
12# jruby test.rb
2Errno::EPIPE: Broken pipe - <STDOUT>
write at org/jruby/
write at org/jruby/
write at org/jruby/
print at org/jruby/
print at org/jruby/
<main> at -e:1
Note: the failure occurs both with Java 21
The root cause is that pipes are created non-blocking with Java 21.
The workaround for the stream issue is below:
----
require 'fcntl'
flags = write.fcntl(
# We must first set nonblock because the Java and JRuby objects wrapping the stream do not know it is already non-blocking
write.fcntl(
write.fcntl(
----
Related branches
- Pushkar Kulkarni (community): Approve
- git-ubuntu import: Pending requested
-
Diff: 121 lines (+50/-4)6 files modifieddebian/changelog (+12/-0)
debian/control (+2/-1)
debian/patches/0014-jruby-8081-invert-o-nonblock-flag.patch (+26/-0)
debian/patches/series (+1/-0)
debian/rules (+6/-0)
debian/tests/control (+3/-3)
description: | updated |
summary: |
- flaky jruby TestOpen3 pipe tests + jruby: mri-extra - flaky TestOpen3 pipe tests |
tags: | added: update-excusse |
tags: |
added: update-excuse removed: update-excusse |
description: | updated |
description: | updated |
description: | updated |
description: | updated |
Changed in jruby (Debian): | |
status: | Unknown → New |
Note: spec-ruby and mri-stdlib fail occasionally during autopkgtest run in cloud, but pass locally.