You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudberry.apache.org by yj...@apache.org on 2025/01/20 04:03:12 UTC

(cloudberry) 15/25: Fix gpstop pipeline flakiness after #15727

This is an automated email from the ASF dual-hosted git repository.

yjhjstz pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/cloudberry.git

commit 04647e24486337d3f307b88388d3df0a65ef578e
Author: sruthip2 <sr...@vmware.com>
AuthorDate: Sat Aug 26 15:34:16 2023 +0530

    Fix gpstop pipeline flakiness after #15727
    
    Following the merging of changes from pull request #15727, there was an intermittent test failure in
    gpstop. This situation occurred when testing how the gpstart process behaves in the presence of a
    lock directory created by a previous gpstop operation.
    
    In this specific scenario, the expected behavior was that the lock directory from gpstop shouldn't
    disrupt the gpstart process. To examine this, a test was set up where a gpstop process was started
    and stopped before completion. This created a lock directory in COORDINATOR_DATA_DIRECTORY.
    Subsequently, an attempt was made to clean up any remaining parts of the postgres process on the
    coordinator using the 'pkill postgres' command. This was essential to prevent issues where
    gpstart might fail with errors like ‘Greenplum instance already exists’. But sometimes, the remaining
    parts of the postgres process didn't get cleaned up properly, causing the test to fail with the error
    ‘gpstart error: Coordinator instance process running’.
    
    To fix this, added a step for cleaning all the postgres processes on the host by removing the lock file
    ‘/tmp/.s.PGSQL.*' along with ‘pkill -9 postgres’ to make sure everything is cleaned up.
---
 gpMgmt/test/behave/mgmt_utils/steps/unreachable_hosts_mgmt_utils.py | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/gpMgmt/test/behave/mgmt_utils/steps/unreachable_hosts_mgmt_utils.py b/gpMgmt/test/behave/mgmt_utils/steps/unreachable_hosts_mgmt_utils.py
index d659e6f681..4296061fea 100644
--- a/gpMgmt/test/behave/mgmt_utils/steps/unreachable_hosts_mgmt_utils.py
+++ b/gpMgmt/test/behave/mgmt_utils/steps/unreachable_hosts_mgmt_utils.py
@@ -1,5 +1,6 @@
 import subprocess
 import tempfile
+import socket
 
 from behave import given, when, then
 
@@ -88,7 +89,10 @@ def _blackhole_route_helper(disconnect_host, hosts, disconnect=False):
         subprocess.check_output(["ssh", host, cmd])
 
 @given('all postgres processes are killed on "{disconnected}" hosts')
+@then('all postgres processes are killed on "{disconnected}" hosts')
 def impl(context, disconnected):
+    if disconnected == "current":
+        disconnected = socket.gethostname()
     disconnected_hosts = disconnected.split(',')
 
     # clean up disconnected


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cloudberry.apache.org
For additional commands, e-mail: commits-help@cloudberry.apache.org