rubycdp / ferrum

Headless Chrome Ruby API
https://ferrum.rubycdp.com
MIT License
1.69k stars 120 forks source link

Use Java ProcessBuilder for JRuby process launch #401

Open jemelyah opened 10 months ago

jemelyah commented 10 months ago

References https://github.com/rubycdp/ferrum/issues/400.

For the JRuby implementations, use Java ProcessBuilder to redirect Chrome process output to a specific file instead of stdout.

route commented 10 months ago

For JRuby implementation we need to add it to matrix, I wouldn't merge just one bit of the process I believe it's much harder than this. Can you add it to matrix?

jemelyah commented 10 months ago

@route

Can you add it to matrix?

Sorry, I missed the reference. Do you mean their communications channel on Matrix?

route commented 10 months ago

Oh I meant to https://github.com/rubycdp/ferrum/blob/main/.github/workflows/tests.yml Let's see how it's failing on CI

jemelyah commented 9 months ago

Oh I meant to https://github.com/rubycdp/ferrum/blob/main/.github/workflows/tests.yml Let's see how it's failing on CI

@route I have added jruby to the tests.yml, but it seems it needs approval to run.

route commented 9 months ago

Looks like at some point connection to browser crashes and then after that all tests failing

route commented 8 months ago

@jemelyah could you please rebase against latest main branch?

jemelyah commented 8 months ago

@route just pushed the merged changes

jemelyah commented 6 months ago

@route would you mind taking a look at the current PR, if it is ok, then I'll try to handle the original issue described here: Issue 402

route commented 6 months ago

On it

jemelyah commented 6 months ago

@route I've updated the code to reflect latest changes in Process class; however, my local tests are still failing, so I'll need to figure out how to handle the problems.

jemelyah commented 6 months ago

Added JRuby to the matrix once again, lost it somewhere.

jemelyah commented 5 months ago

@route I was finally able to get the tests going locally, by redirecting the process output to the buffered reader instead of a file. Is it possible to run the test suite once again on the matrix?

route commented 4 months ago

@jemelyah how long does it take to tests to pass locally?

route commented 4 months ago

I cannot test it on windows but I cannot even install gems on jruby 9.4.5.0 (3.1.4) 2023-11-02 1abae2700f Java HotSpot(TM) 64-Bit Server VM 19.0.1+10-21 on 19.0.1+10-21 +jit [arm64-darwin] on my mac. It's failing.

jemelyah commented 1 month ago

@route, sorry for the delay; we are solving some issues with our solution to this; I hope to update this PR when we are done.

jemelyah commented 1 month ago

@route, unfortunately, it fails and hangs with Exception handling servers: #<IOError: closed stream> in the test environment for jruby-9.4. Locally, the tests pass, so I'll try to replicate and investigate the closed stream issue.

route commented 1 month ago

This looks very familiar to me, as I faced it long ago https://github.com/rubycdp/ferrum/issues/15 It works much slower in github actions.