Skip to content

Fix spawn_spec.rb for Travis arm64 environment.#2653

Merged
k0kubun merged 1 commit into
ruby:masterfrom
junaruga:hotfix/travis-arm64-spec
Nov 6, 2019
Merged

Fix spawn_spec.rb for Travis arm64 environment.#2653
k0kubun merged 1 commit into
ruby:masterfrom
junaruga:hotfix/travis-arm64-spec

Conversation

@junaruga

@junaruga junaruga commented Nov 6, 2019

Copy link
Copy Markdown
Member

Right now there is a test failure on Travis arm64 environment like this.

https://travis-ci.org/ruby/ruby/jobs/608243655#L2664

1)
Process.spawn joins the specified process group if pgroup: pgid FAILED
Expected (STDOUT): "0"
          but got: "34876"
Backtrace
/home/travis/build/ruby/ruby/spec/ruby/core/process/spawn_spec.rb:334:in `block (3 levels) in <top (required)>'
/home/travis/build/ruby/ruby/spec/ruby/core/process/spawn_spec.rb:32:in `<top (required)>'

The reason is the value of Process.getpgid(Process.pid) is 0 in the environment.

https://ruby-doc.org/core-2.7.0.preview2/Process.html#method-c-getpgid
The document says "Returns the process group ID for the given process id. Not available on all platforms.".

Seeing the proc file,

The process group id (/proc/[pid]/stat" 5th field) is 0 in the Travis arm64 environment.

This is a case where it is available on my local environment.

$ cat /proc/4543/stat
4543 (ruby) S 4525 4525 1384 34818 4525 4194304 37443 1754841 0 0 366 105 2291 391 20 0 3 0 1381328 1428127744 11475 18446744073709551615 94195983785984 94195986670225 140728933833312 0 0 0 0 0 1107394127 0 0 0 17 2 0 0 1 0 0 94195987686512 94195987708942 94196017770496 140728933835483 140728933835595 140728933835595 140728933842904 0

This is a case where it is not available in Travis arm64 environment.

$ cat /proc/19179/stat
19179 (ruby) S 19160 0 0 0 -1 4194560 37618 1710547 313 163 770 665 5206 1439 20 0 2 0 17529566 1196347392 10319 18446744073709551615 187650811428864 187650815023116 281474602721280 0 0 0 0 4096 1107390031 0 0 0 17 22 0 0 0 0 0 187650815091456 187650815114064 187651414974464 281474602725080 281474602725211 281474602725211 281474602729420 0

See "cat /proc/[pid]/stat" and "man proc" - /proc/[pid]/stat

It might be better to merge this PR before fixing the random error in make install (#2642).

The process group id (/proc/[pid]/stat 5th field) is 0
in the Travis arm64 environment.

This is a case where it is available.

$ cat /proc/4543/stat
4543 (ruby) S 4525 4525 1384 34818 4525 4194304 37443 1754841 0 0 366 105 2291 391 20 0 3 0 1381328 1428127744 11475 18446744073709551615 94195983785984 94195986670225 140728933833312 0 0 0 0 0 1107394127 0 0 0 17 2 0 0 1 0 0 94195987686512 94195987708942 94196017770496 140728933835483 140728933835595 140728933835595 140728933842904 0

This is a case where it is not available in Travis arm64 environment.

$ cat /proc/19179/stat
19179 (ruby) S 19160 0 0 0 -1 4194560 37618 1710547 313 163 770 665 5206 1439 20 0 2 0 17529566 1196347392 10319 18446744073709551615 187650811428864 187650815023116 281474602721280 0 0 0 0 4096 1107390031 0 0 0 17 22 0 0 0 0 0 187650815091456 187650815114064 187651414974464 281474602725080 281474602725211 281474602725211 281474602729420 0

See "man proc" for detail.
@junaruga

junaruga commented Nov 6, 2019

Copy link
Copy Markdown
Member Author

Travis arm64 is okay.
https://travis-ci.org/ruby/ruby/jobs/608286138

@k0kubun k0kubun left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! 👍

@k0kubun k0kubun merged commit f5c7fc4 into ruby:master Nov 6, 2019
@junaruga

junaruga commented Nov 6, 2019

Copy link
Copy Markdown
Member Author

Thanks!

@junaruga junaruga deleted the hotfix/travis-arm64-spec branch December 3, 2019 12:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants