Project

General

Profile

Actions

Bug #13609

closed

CI error on travis at spec for Process.setpriority

Added by duerst (Martin Dürst) almost 7 years ago. Updated almost 7 years ago.

Status:
Closed
Target version:
-
ruby -v:
ruby 2.5.0dev (2017-05-29 trunk 58953) [x86_64-cygwin]
[ruby-core:81448]

Description

Trying to make a commit (r58954) for issue #13590, I got a CI error at https://travis-ci.org/ruby/ruby/builds/237086017. Reverting at r58955, the problem persisted at https://travis-ci.org/ruby/ruby/builds/237090520.

The error looked unrelated to the commit, and that it is not gone when reverting shows that it is indeed unrelated, so I'm raising this issue. For details, please see below.

The command "make -s $JOBS test-all -o exts TESTOPTS='-q --color=never --job-status=normal'" exited with 0.

7.28s$ make -s $JOBS test-rubyspec MSPECOPT=-j

generating x86_64-linux-fake.rb

x86_64-linux-fake.rb updated

ruby 2.5.0dev (2017-05-29 trunk 58955) [x86_64-linux]

[- | ==================100%================== | 00:00:00]      0F      0E 

1)

Process.setpriority sets the scheduling priority for a specified process group FAILED

Expected 0

 to equal 1

/home/travis/build/ruby/ruby/spec/rubyspec/core/process/setpriority_spec.rb:29:in `block (3 levels) in <top (required)>'

https://travis-ci.org/ruby/ruby/builds/237090520


/home/travis/build/ruby/ruby/spec/rubyspec/core/process/setpriority_spec.rb:3:in `<top (required)>'

Finished in 7.106548 seconds

3569 files, 26410 examples, 201546 expectations, 1 failure, 0 errors, 0 tagged

make: *** [yes-test-spec] Error 1

The command "make -s $JOBS test-rubyspec MSPECOPT=-j" exited with 2.

Done. Your build exited with 1.

Updated by nobu (Nobuyoshi Nakada) almost 7 years ago

  • Description updated (diff)

It occurs sporadically in these days.

It seems a race condition between getpriority and setpriority in a process group.

# bug-13609.rb
Process.setpgrp
pr = Process.getpriority(Process::PRIO_PGRP, 0)
fork {Process.getpriority(Process::PRIO_PGRP, 0)}
Process.setpriority(Process::PRIO_PGRP, 0, pr+1)
unless Process.getpriority(Process::PRIO_PGRP, 0) == pr+1
  raise ARGV[0]
end
$ ./miniruby -v; i=0; while [ $i -lt 100 ] && ./miniruby bug-13609.rb $[++i]; do :; done
ruby 2.5.0dev (2017-05-29 trunk 58958) [x86_64-linux]
Traceback (most recent call last):
bug-13609.rb:7:in `<main>': 24 (RuntimeError)

I'm not sure if this is an expected behavior, I think this test should be run in a separate process group.

Actions #2

Updated by nobu (Nobuyoshi Nakada) almost 7 years ago

  • Status changed from Open to Closed

Applied in changeset trunk|r58959.


Run in separate process/pgrp [Bug #13609]

Updated by Eregon (Benoit Daloze) almost 7 years ago

Thanks for the fix nobu!

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0