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

Running tests with rake causes a hanging process. #5

Closed
Maturin opened this issue Nov 27, 2014 · 4 comments
Closed

Running tests with rake causes a hanging process. #5

Maturin opened this issue Nov 27, 2014 · 4 comments

Comments

@Maturin
Copy link

Maturin commented Nov 27, 2014

After executing

rake test

the process does nothing and never returns. Very interesting is that this depends on the number of test scripts.

I did some debugging. Rake collects all the test and creates a string for launching another ruby process, which actually runs the test. After shorting the string, the specified tests are executed. If I check the started ruby process in the process explorer, it shows me only '�' as command line.

Environment:

Windows 7
Ruby 2.14 (RubyInstaller)
Rake 10.4.0, 10.1.0

Running the same tests on a Linux box or using JRuby on Windows is working.

@Maturin
Copy link
Author

Maturin commented Dec 2, 2014

This seems to be a generally issue of the Windows Ruby Installer version. The system call accepts two different formats:

a) system(cmd, arg1, arg2, arg3, ..)
b) system("cmd arg1 arg2 arg2 ...")

When in the second case the command string about 1024 character exceeds, the second process is not launched correctly. I assume this also happens if the command or one argument of a) exceeds 1024 characters too, but I haven't tested this yet.

I tested it also with these Rubies without a problem:

  • JRuby 1.7.16.1
  • Ruby 1.8.5 (Windows)
  • Ruby 2.1.4 (Linux)

So I will create a Ruby bug report for the RubyInstaller version too.

@Maturin
Copy link
Author

Maturin commented Dec 2, 2014

As mentioned above I have raised this ruby bug: https://bugs.ruby-lang.org/issues/10563

Anyway I figured out that this is related to how the ruby interpreter is specified:

C:/somdir/ruby/bin/ruby.exe

vs

C:\somedir\ruby\bin\ruby.exe 

I added locally some small changes to file_utils.rb for using the second way of specifying the ruby interpreter. I think of this of a local temporary hack. But in case you are interested, I share it.

@drbrain
Copy link
Member

drbrain commented Dec 3, 2014

Does changing the Rake::TestTask loader help?

This may be a limitation of the Windows command line interface in ruby.

@Maturin
Copy link
Author

Maturin commented Dec 3, 2014

Actually I haven't tested different loader settings. As mentioned above this is a Ruby issue. Meanwhile the according bug (https://bugs.ruby-lang.org/issues/10563) was fixed and closed. Looks like it will be available for windows with Ruby 2.2 and Ruby 2.1.6.

So in my opinion we can close this issue too.

@Maturin Maturin closed this as completed Dec 3, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants