grosser / autotest

Save a file, autotest will run the matching tests! (Autotest without ZenTest)
121 stars 20 forks source link

[Windows] autotest-standalone-4.5.2/lib/unit_diff.rb:77:in `write': Invalid argument (Errno::EINVAL) #18

Closed jeygeethan closed 12 years ago

jeygeethan commented 13 years ago

I get this error when trying to run autotest-standalone. When I replaced putc of lib/autotest.rb @ 284 to 'print', it worked fine. I know 'print' breaks the coloring on windows machines. Is this a problem with autotest or my ruby version?

Gems installed : autotest (4.4.5) autotest-rails-pure (4.1.2)

ruby --version : ruby 1.8.6 (2010-02-04 patchlevel 398) [i386-mingw32]

grosser commented 13 years ago

can you try to replace line 77 with this output.putc (c.is_a?(Fixnum) ? c.chr : c)

jeygeethan commented 13 years ago

No it didnt work.

I figured that STDOUT.flush in testrunner is causing this problem.

This the following full stacktrace :

C:/Ruby/lib/ruby/gems/1.8/gems/autotest-standalone-4.5.2/lib/unit_diff.rb:77:in write': Invalid argument (Errno::EINVAL) from C:/Ruby/lib/ruby/gems/1.8/gems/autotest-standalone-4.5.2/lib/unit_diff.rb:77:inputc' from C:/Ruby/lib/ruby/gems/1.8/gems/autotest-standalone-4.5.2/lib/unit_diff.rb:77:in parse_input' from C:/Ruby/lib/ruby/gems/1.8/gems/autotest-standalone-4.5.2/lib/unit_diff.rb:196:inunit_diff' from C:/Ruby/lib/ruby/gems/1.8/gems/autotest-standalone-4.5.2/lib/unit_diff.rb:56:in unit_diff' from C:/Ruby/lib/ruby/gems/1.8/gems/autotest-standalone-4.5.2/bin/unit_diff:44 C:/Ruby/lib/ruby/1.8/test/unit/ui/console/testrunner.rb:113:inflush': Invalid argument (Errno::EINVAL) from C:/Ruby/lib/ruby/1.8/test/unit/ui/console/testrunner.rb:113:in output_single' from C:/Ruby/lib/ruby/1.8/test/unit/ui/console/testrunner.rb:97:intest_finished' from C:/Ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in to_proc' from C:/Ruby/lib/ruby/1.8/test/unit/util/observable.rb:78:incall' from C:/Ruby/lib/ruby/1.8/test/unit/util/observable.rb:78:in notify_listeners' from C:/Ruby/lib/ruby/1.8/test/unit/util/observable.rb:78:ineach' from C:/Ruby/lib/ruby/1.8/test/unit/util/observable.rb:78:in notify_listeners' from C:/Ruby/lib/ruby/1.8/test/unit/ui/testrunnermediator.rb:47:inrun_suite' ... 11 levels... from C:/Ruby/lib/ruby/1.8/test/unit/autorunner.rb:216:in run' from C:/Ruby/lib/ruby/1.8/test/unit/autorunner.rb:12:inrun' from C:/Ruby/lib/ruby/1.8/test/unit.rb:278 from -e:1

grosser commented 13 years ago

that`s strange, does removing flush help ?

jeygeethan commented 13 years ago

I removed the two @io.flush statements from the testrunner.rb and still it showed the errorat unit_diff.rb:77.

Then I changed the output.putc to output.putc (c.is_a?(Fixnum) ? c.chr : c) at unit_diff.rb:77 and still the same error at unit_diff.rb:77

unit_diff.rb:77:in `write': Invalid argument (Errno::EINVAL)

grosser commented 13 years ago

so only changing to print helps ? I think ill install some windows+ruby somewhere and try to poke it a bit :>

jeygeethan commented 13 years ago

Yea, print helps. I'll try another version of ruby (possibly 1.9.2) and let you know about this

goliatone commented 12 years ago

I can confirm that by replacing to print fixes the error. I had the same issue. Windows 7, ruby 1.8.6, autotest-standalone-4.5.8. The weird thing is that I had it running ok for a few days, then the error showed up consistently every time I tried to run autotest.

grosser commented 12 years ago

see if you got ZenTest or autotest-standalone installed (or both), can you try something like

begin write xxx rescue Errno::EINVAL print xxx end

maybe thats a good solution to have color if possible and some output if not

goliatone commented 12 years ago

I have autotest but not ZenTest. Tried your snippet, seems to be working. I have not enabled color so can't check that.

grosser commented 12 years ago

please give 4.5.9 a try :)

goliatone commented 12 years ago

ok, i updated autoinstall and get the following: (druby://localhost:49963) c:/Ruby187/lib/ruby/1.8/drb/drb.rb:1558:inwrite': Invalid argument (Errno::EINVAL) from (druby://localhost:49963) c:/Ruby187/lib/ruby/1.8/drb/drb.rb:1558:in puts' from (druby://192.168.1.129:49943) c:/Ruby187/lib/ruby/gems/1.8/gems/rspec-core-2.7.1/lib/rspec/core/formatters/progress_formatter.rb:25:instart_dump' from (druby://192.168.1.129:49943) c:/Ruby187/lib/ruby/gems/1.8/gems/rspec-core-2.7.1/lib/rspec/core/reporter.rb:74:in send' from (druby://192.168.1.129:49943) c:/Ruby187/lib/ruby/gems/1.8/gems/rspec-core-2.7.1/lib/rspec/core/reporter.rb:74:innotify' from (druby://192.168.1.129:49943) c:/Ruby187/lib/ruby/gems/1.8/gems/rspec-core-2.7.1/lib/rspec/core/reporter.rb:73:in each' from (druby://192.168.1.129:49943) c:/Ruby187/lib/ruby/gems/1.8/gems/rspec-core-2.7.1/lib/rspec/core/reporter.rb:73:innotify' from (druby://192.168.1.129:49943) c:/Ruby187/lib/ruby/gems/1.8/gems/rspec-core-2.7.1/lib/rspec/core/reporter.rb:21:in finish' from (druby://192.168.1.129:49943) c:/Ruby187/lib/ruby/gems/1.8/gems/rspec-core-2.7.1/lib/rspec/core/reporter.rb:14:inreport' from (druby://192.168.1.129:49943) c:/Ruby187/lib/ruby/gems/1.8/gems/rspec-core-2.7.1/lib/rspec/core/command_line.rb:21:in run' from (druby://192.168.1.129:49943) c:/Ruby187/lib/ruby/gems/1.8/gems/rspec-core-2.7.1/lib/rspec/monkey/spork/test_framework/rspec.rb:5:inrun_tests' from (druby://192.168.1.129:49943) ./magazine_slave.rb:22:in run' from (druby://127.0.0.1:8989) c:/Ruby187/lib/ruby/gems/1.8/gems/spork-0.8.5/lib/spork/run_strategy/magazine.rb:87:inrun' from (druby://127.0.0.1:8989) c:/Ruby187/lib/ruby/gems/1.8/gems/spork-0.8.5/lib/spork/server.rb:47:in run' from c:/Ruby187/lib/ruby/gems/1.8/gems/rspec-core-2.7.1/lib/rspec/core/drb_command_line.rb:19:inrun' from c:/Ruby187/lib/ruby/gems/1.8/gems/rspec-core-2.7.1/lib/rspec/core/runner.rb:76:in run_over_drb' from c:/Ruby187/lib/ruby/gems/1.8/gems/rspec-core-2.7.1/lib/rspec/core/runner.rb:63:inrun' from c:/Ruby187/lib/ruby/gems/1.8/gems/rspec-core-2.7.1/lib/rspec/core/runner.rb:10:in autorun' from c:/Ruby187/lib/ruby/gems/1.8/gems/rspec-core-2.7.1/exe/rspec:4

grosser commented 12 years ago

thats coming from rspec, which means your system is somehow broken, and every 'write' causes this error. you can either contact the rspec guys with this error or just try to e.g. reinstall ruby and see if it goes away (my recommendation: do not use windows or use vagrant in windows to get an unix environment, to avoid these kind of issues)