From be0366d5878841ca2dd3a759f1e70b056688c295 Mon Sep 17 00:00:00 2001
From: Sam <sam.saffron@gmail.com>
Date: Wed, 11 Apr 2018 16:39:39 +1000
Subject: [PATCH] add debugging for docker test

---
 lib/tasks/docker.rake | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/lib/tasks/docker.rake b/lib/tasks/docker.rake
index f75b7ea76bd..46b27fa95af 100644
--- a/lib/tasks/docker.rake
+++ b/lib/tasks/docker.rake
@@ -12,6 +12,7 @@
 # => SINGLE_PLUGIN             set to plugin name to only run plugin-specific rspec tests (you'll probably want to SKIP_CORE as well)
 # => BISECT                    set to 1 to run rspec --bisect (applies to core rspec tests only)
 # => RSPEC_SEED                set to seed to use for rspec tests (applies to core rspec tests only)
+# => PAUSE_ON_TERMINATE        set to 1 to pause prior to terminating redis and pg
 #
 # Other useful environment variables (not specific to this rake task)
 # => COMMIT_HASH    used by the discourse_test docker image to load a specific commit of discourse
@@ -118,6 +119,11 @@ task 'docker:test' do
   ensure
     puts "Terminating"
 
+    if ENV['PAUSE_ON_TERMINATE']
+      puts "Pausing prior to termination"
+      gets
+    end
+
     Process.kill("TERM", @redis_pid) if @redis_pid
     Process.kill("TERM", @pg_pid) if @pg_pid
     Process.wait @redis_pid if @redis_pid