From addaeaa5646961ee84264ed1b6ddbe0bdf4ea598 Mon Sep 17 00:00:00 2001 From: Thomas Fini Hansen Date: Wed, 22 Nov 2023 21:04:43 +0100 Subject: [PATCH 1/3] Only sleep for a second while waiting for shutdown --- src/marionette/service.cr | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/marionette/service.cr b/src/marionette/service.cr index 863cbc0..3e51f4b 100644 --- a/src/marionette/service.cr +++ b/src/marionette/service.cr @@ -62,7 +62,7 @@ module Marionette HTTP::Client.get(File.join(url.to_s, "shutdown")) 0.upto(30).each do if open? - sleep 1000 + sleep 1 else break end From 48a6b4dcd31d9557c245b551fb7b3d377344a67c Mon Sep 17 00:00:00 2001 From: Thomas Fini Hansen Date: Wed, 22 Nov 2023 21:05:29 +0100 Subject: [PATCH 2/3] Don't send shutdown command to geckodriver It doesn't support it and waiting thirty seconds for it to not obey the command is a waste of time. --- src/marionette/service.cr | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/marionette/service.cr b/src/marionette/service.cr index 3e51f4b..a3f8a44 100644 --- a/src/marionette/service.cr +++ b/src/marionette/service.cr @@ -84,7 +84,11 @@ module Marionette def stop if process = @process - send_remote_shutdown + # geckodriver does not support remote shutdown, so don't try + # and wait for it to close gracefully. + unless @browser.is_a?(Browser::Firefox) + send_remote_shutdown + end begin process.signal(Signal::INT) From 97d9e0a37ed3c0870242c00f3081cb25c026ba5c Mon Sep 17 00:00:00 2001 From: Thomas Fini Hansen Date: Wed, 22 Nov 2023 21:08:53 +0100 Subject: [PATCH 3/3] Fix badge Ref https://github.com/badges/shields/issues/8671 --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 577ece1..f92644c 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ **Looking for a co-maintainer for Marionette**. If interested just respond in the issue titled "Looking for a co-maintainer". -![GitHub Workflow Status](https://img.shields.io/github/workflow/status/watzon/marionette/specs?style=flat-square) ![License](https://img.shields.io/github/license/watzon/marionette?style=flat-square) ![Crystal Version](https://img.shields.io/badge/Crystal-1.0.0-%23333333?style=flat-square) +![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/watzon/marionette/specs.yml?branch=master&style=flat-square) ![License](https://img.shields.io/github/license/watzon/marionette?style=flat-square) ![Crystal Version](https://img.shields.io/badge/Crystal-1.0.0-%23333333?style=flat-square)