Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using parallel_split_test, seeing Errno::ENOENT: No such file or directory - /usr/sbin/sysctl #300

Closed
pamgluss-slack opened this issue Aug 25, 2021 · 16 comments

Comments

@pamgluss-slack
Copy link

pamgluss-slack commented Aug 25, 2021

Error we're getting:
bundle exec parallel_split_test spec --tag ~unstable --tag ~skip_regression 17:29:50 bundler: failed to load command: parallel_split_test (/mnt/jenkinsslave/workspace/webapp-regression-api/tests/rspec-api-tests/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/bin/parallel_split_test) 17:29:50 Errno::ENOENT: No such file or directory - /usr/sbin/sysctl

The time we started seeing this was 3:30 PM on our Jenkins builds. This lines up with the release of 1.20.2. A workaround is for us to use 1.20.1 but I wanted to bring this to yalls attention.

Ruby version 2.4.1
Rspec Version 3.9.0

@grosser
Copy link
Owner

grosser commented Aug 25, 2021

thx
comes from

IO.popen("/usr/sbin/sysctl -n hw.physicalcpu").read.to_i

are you running on mac ?
what does /usr/sbin/sysctl -n hw.physicalcpu return ?
what is which sysctl ?

@grosser
Copy link
Owner

grosser commented Aug 25, 2021

/cc @pedromartinez

@pedromartinez
Copy link
Contributor

pedro@pedros-mac-mini ~ % /usr/sbin/sysctl -n hw.physicalcpu
6

@pedromartinez
Copy link
Contributor

I'll open a PR to revert.

@pedromartinez
Copy link
Contributor

#301

@pedromartinez
Copy link
Contributor

pedromartinez commented Aug 25, 2021

Note:

physical_processor_count appears to be used in the parallel_split_test gem but not in parallel_tests.

Even after my PR, parallel tests still returned 12 for processor_count.

Reference:
https://github.com/grosser/parallel_split_test/blob/9ea3365898311165da5dd426f3b5ff4dc71fc515/lib/parallel_split_test.rb#L19

@grosser
Copy link
Owner

grosser commented Aug 25, 2021

@pamgluss-slack can you try and find out why sysctl is missing for you ?

@grosser
Copy link
Owner

grosser commented Aug 25, 2021

it uses processor_count https://github.com/grosser/parallel_tests/blob/master/lib/parallel_tests.rb#L20
that seems bad since either one or the other is better for tests, so if you can find out if 6/12 is best then we can change one or the other

@grosser
Copy link
Owner

grosser commented Aug 25, 2021

let's revert for now since it looks like we need a different fix

@pamgluss-slack
Copy link
Author

pamgluss-slack commented Aug 25, 2021

I can get details for you guys in the morning PST, but I believe Jenkins runs Linux machines

os.arch | amd64
os.name | Linux
os.version | 4.4.0-1106-aws

@pedromartinez
Copy link
Contributor

pedromartinez commented Aug 25, 2021

@grosser I agree, it should probably use the same method for both libraries.

Here are two different work projects.

A smaller project:

6x:

426 examples, 0 failures
Took 50 seconds

12x:

426 examples, 0 failures
Took 59 seconds

and

A larger project:

6x:

8949 examples, 0 failures, 4 pendings
Took 406 seconds (6:46)

12x:

8949 examples, 0 failures, 4 pendings
Took 332 seconds (5:32)

@pedromartinez
Copy link
Contributor

For reference:

pedro@pedros-mac-mini % sysctl -n hw.physicalcpu
6

pedro@pedros-mac-mini  % sysctl -n hw.ncpu       
12

@grosser
Copy link
Owner

grosser commented Aug 25, 2021 via email

@pedromartinez
Copy link
Contributor

Agreed!

grosser added a commit to grosser/parallel_split_test that referenced this issue Aug 28, 2021
see grosser/parallel#300
it seems to be faster and it is the same as parallel_tests uses
@grosser
Copy link
Owner

grosser commented Aug 28, 2021

done

@grosser grosser closed this as completed Aug 28, 2021
@grosser
Copy link
Owner

grosser commented Sep 13, 2021

should be fixed in 1.21.0

morganpeterharris added a commit to morganpeterharris/parallel_split_test that referenced this issue Mar 2, 2022
see grosser/parallel#300
it seems to be faster and it is the same as parallel_tests uses
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

No branches or pull requests

3 participants