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

Parallel test execution fails since version 1.17.1 #285

Open
DLeich opened this issue Sep 25, 2020 · 3 comments
Open

Parallel test execution fails since version 1.17.1 #285

DLeich opened this issue Sep 25, 2020 · 3 comments

Comments

@DLeich
Copy link

DLeich commented Sep 25, 2020

It looks like parallel test execution has been broken since 1.17.1 was released. I get the following output when executing bundle exec onceover run spec --parallel on every version after 1.17.0:

Error while running: #<NoMethodError: undefined method `cooked!' for #<IO:<STDERR>>>

@alexjfisher
Copy link
Member

Fixed in #280

Can you work around by adding require 'io/console' to the end of your Gemfile?

@DLeich
Copy link
Author

DLeich commented Oct 7, 2020

Confirmed that adding require 'io/console' worked. Thanks! I'm guessing this will be officially fixed with the next release, since #280 has already been merged.

@codylane
Copy link

codylane commented Oct 7, 2020

Just posting as I have also been testing this and adding require 'io/console to my Gemfile.

After whacking the Gemfile.lock and running bundle install the once over--parallel execution started working.

I'm also curious if you think it would be a good idea to test for the #coooked! method prior to using it?

For example this line: https://github.com/dylanratcliffe/onceover/blob/v3.18.1/lib/onceover/runner.rb#L133

Could also be this

STDERR.cooked! if STDERR.isatty && STDERR.respond_to?(:cooked!)

Or perhaps we could even do this incase there is no TTY and the #cooked! isn't available either.

      begin
        STDERR.raw! if STDERR.isatty
        result = Backticks::Runner.new(interactive: true).run(args.flatten).join
      ensure
        begin
          STDERR.cooked! if STDERR.isatty
        rescue NoMethodError
          STDERR.write("My custom error message...")
        end
     end

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