diff --git a/regression-test/suites/insert_p0/test_insert_visible_timeout_return_mode.groovy b/regression-test/suites/insert_p0/test_insert_visible_timeout_return_mode.groovy index 978bd137d8ead5..fdf3ffdf0c9f1f 100644 --- a/regression-test/suites/insert_p0/test_insert_visible_timeout_return_mode.groovy +++ b/regression-test/suites/insert_p0/test_insert_visible_timeout_return_mode.groovy @@ -25,10 +25,6 @@ suite("test_insert_visible_timeout_return_mode", "nonConcurrent") { def tableName = "test_insert_visible_timeout_return_mode_tbl" def debugPoint = "PublishVersionDaemon.stop_publish" - // Use the configured FE HTTP endpoint so the case also works when SHOW FRONTENDS exposes loopback addresses. - def feHttpAddress = context.config.feHttpAddress - def feHost = feHttpAddress.split(":")[0] - def feHttpPort = Integer.parseInt(feHttpAddress.split(":")[1]) // Prepare a single-replica table so publish blocking deterministically drives the visible timeout path. sql """ DROP TABLE IF EXISTS ${tableName} FORCE """ @@ -43,9 +39,15 @@ suite("test_insert_visible_timeout_return_mode", "nonConcurrent") { ) """ + def masterFe = sql_return_maparray("SHOW FRONTENDS").find { it.IsMaster == "true" } + assertNotNull(masterFe, "Could not find master FE") + def masterFeHost = masterFe.Host as String + def masterFeHttpPort = masterFe.HttpPort as int + try { - // Block FE publish so inserts can commit but remain non-visible until the debug point is removed. - DebugPoint.enableDebugPoint(feHost, feHttpPort, NodeType.FE, debugPoint) + // PublishVersionDaemon only runs on the master FE. Keep the SQL connection unchanged and + // inject the fault directly into the master identified by the same SHOW FRONTENDS snapshot. + DebugPoint.enableDebugPoint(masterFeHost, masterFeHttpPort, NodeType.FE, debugPoint) sql """ SET insert_visible_timeout_ms = 1000 """ @@ -61,7 +63,7 @@ suite("test_insert_visible_timeout_return_mode", "nonConcurrent") { } } finally { try { - DebugPoint.disableDebugPoint(feHost, feHttpPort, NodeType.FE, debugPoint) + DebugPoint.disableDebugPoint(masterFeHost, masterFeHttpPort, NodeType.FE, debugPoint) } catch (Throwable e) { logger.warn("Failed to disable debug point ${debugPoint}", e) }