elasticsearch-ruby icon indicating copy to clipboard operation
elasticsearch-ruby copied to clipboard

Test Cluster incompatible with windows

Open SleeplessByte opened this issue 7 years ago • 1 comments

There are currently a few issues with the elasticsearch-extensions and Windows compatibility:

  1. #503 patron gem
  2. path can't be determined
  3. /dev/null does not exist on windows
  4. shutdown getpgid does not exist on windows, KILL does not work.

The workarounds are as follows:

  1. clone and remove the patron dev dependency
  2. pass in command: <path to elasticsearch> to #start #stop and #running?
  3. turn on ENV['DEBUG'] or replace /dev/null with NUL: on windows (e.g. RUBY_PLATFORM =~ /mswin/ or Gem.win_platform?)
  4. rescue and ignore (it's shut down), manually do a taskkill.

They are basically one-liners to fix, and I would propose a bit of documentation, but otherwise the gem works as expected 👍

SleeplessByte avatar Apr 06 '18 01:04 SleeplessByte

@SleeplessByte, many thanks for the report, this is useful!

The extension is naturally brittle, given all the variability across operating systems, ES versions, Ruby versions, ... despite it's popularity.

For a long time, I would like to refactor it to use Docker as the runner, since Elastic provides Docker images from version 5.x upwards. This should mitigate many problems, with the only downside that a Docker-based runner wouldn't work for lower versions.

karmi avatar Apr 25 '18 12:04 karmi