This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2023-08-07
Channels
- # aleph (7)
- # announcements (1)
- # babashka (31)
- # beginners (18)
- # calva (23)
- # cljdoc (10)
- # clojure (74)
- # clojure-europe (42)
- # clojure-norway (10)
- # clojure-uk (1)
- # clojurescript (19)
- # core-async (2)
- # cursive (188)
- # data-science (11)
- # datahike (1)
- # datascript (4)
- # events (2)
- # figwheel-main (23)
- # fulcro (5)
- # gratitude (2)
- # honeysql (3)
- # hyperfiddle (120)
- # jobs (3)
- # lsp (3)
- # meander (6)
- # missionary (8)
- # nrepl (1)
- # off-topic (5)
- # rdf (11)
- # releases (4)
- # remote-jobs (1)
- # sci (5)
- # tools-build (3)
- # tools-deps (14)
Hi y'all! 👋
Having some trouble adopting https://figwheel.org/docs/testing.html for the https://developer.chrome.com/articles/new-headless/:
On macOS (13.5, Intel), chrome
runs the tests but won't terminate. Looks more like a chrome
issue to me to be honest, but maybe I just missed something important.
Anyone successfully running tests using headless chrome (>=115) without chrome
processes laying uselessly around afterwards?
Hey! Yes, I just resolved this for our CI recently. The issue (as far as I understand): • chrome is run and immediately exits • figwheel-main doesn’t know chrome isn’t running and just keeps going (because it never receives a success/error msg) Solution I used:
path/to/chrome/bin --headless --remote-debugging-port=9222 :open-url
You can also try the above with “--headless=new” if you like and, if memory serves, that did work as well
Hi @U6GNVEWQG,
thanks for your quick reply! 🙇
> The issue (as far as I understand):
> • chrome is run and immediately exits
unfortunately not on my machine: Chrome (headless) never terminates...
> • figwheel-main doesn’t know chrome isn’t running and just keeps going (because it never receives a success/error msg)
... and that's why figwheel-main is quiet happy and exits w/ :figwheel.main.testing/success
as expected.
But chrome
does not terminate.
Interesting! That is for sure the flip of what I experienced.
So, your tests run and complete, but then the process just doesn't terminate, yes?
Right. You can even put figwheel-main
completely aside:
/Applications/Google\ Chrome --headless=new --disable-gpu --no-sandbox
Does not terminate.
Using just --headless
(without new
) it does terminate as expected. Adding --repl
– like in the good ol' days 🙂 – has no effect. (Same is true for adding --remote-debugging-port=9222
.)For fun (to get to a minimal scenario)
• can you remove --disable-gpu
and --no-sandbox
?
Test the above.
After the above, can you confirm if you're running a GUI instance of chrome
at the same time as you're running your tests?
Additionally, what does your environment-log (provided by figwheel) say (if anything)
First of all: Thanks for your time and help! I owe you a beer. 🍻
> • can you remove --disable-gpu
and --no-sandbox
?
Removed.
> can you confirm if you're running a GUI instance of chrome
at the same time as you're running your tests?
ps aux | grep -i chrome
No chrome
at all before running the tests.
> Additionally, what does your environment-log (provided by figwheel) say (if anything)
With the --remote-debugging-port=9222
set:
DevTools listening on
Without:
[0807/163430.854680:ERROR:(128)] ContextResult::kTransientFailure: Failed to send GpuControl.CreateCommandBuffer.
And no Tests were executed. (That's why I've added --disable-gpu
in the first place.)
(Adding / removing --repl
has no effect to the results above btw.)> And no Tests where executed. (That's why I've added --disable-gpu
in the first place.)
True, this seemed to happen with --headless=new
Do you have async tests? I'm trying to think if there is something in chrome that makes it want to keep runnning because normally it just exits lol
> Do you have async tests?
I have. (And I do use run-tests-async
.)
> I'm trying to think if there is something in chrome that makes it want to keep runnning because normally it just exits lol
Do you run macOS as well?
Running --headless=new
on a static and simple index.html
with no JavaScript at all does not terminate.
> Do you run macOS as well? yes
> Running --headless=new
on a static and simple index.html
with no JavaScript at all does not terminate.
huh. I wonder what changed with "new". I started digging into the source and then bailed.
ℹ️ Chromium https://bugs.chromium.org/p/chromium/issues/detail?id=1424852: repl stopped working
Aaaand we got an „it‘s by design“ together with a WontFix. (https://bugs.chromium.org/p/chromium/issues/detail?id=1418651)
That's sad, but it sounds like that ticket was about chrome immediately exiting. Wasn't your issue that chrome doesn't exit?
Yes. But the main point is "no --repl". And as far as i know, figwheel uses the repl to send a quit
(or exit
?) to end chrome after the tests. Both together fit into my picture: Chrome doesn't exit because it never receives the quit
command because it doesn't listen on the repl (which means: stdin
.)
(I'm going to check my assumption with a little script-in-the-middle attack in the next days. Shouldn't be too hard to start chrome in the background, listen for quit
on stdin
and kill chrome via kill
in the first place and a fancy DevTools-Command later.)
@U6GNVEWQG I just find out about this thread and your solution solved the issue for my chrome headless CI tests for both mac and linux: https://github.com/skydread1/flybot.sg/pull/264 So thank you! @U1Z4D5SSV my terminal was hanging also for chrome headless tests so maybe my https://github.com/skydread1/flybot.sg/blob/master/tests.cljs.edn can be of any help, hope you already found a solution though!
ℹ️ Chromium https://bugs.chromium.org/p/chromium/issues/detail?id=1424852: repl stopped working