teampoltergeist / poltergeist

A PhantomJS driver for Capybara

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

STDOUT redirection is not thread-safe

afn opened this issue · comments

The redirect_stdout call messes with the global STDOUT and $stdout streams in the parent process (not the child process), which can cause issues if other threads are writing to STDOUT.

One simple approach to fix the issue, at least on MRI, is to let Process.spawn handle the redirection when not running in JRuby. Pull request coming shortly.