@@ -67,6 +67,52 @@ suite("load_stream_fault_injection", "nonConcurrent") {
67
67
file " baseall.txt"
68
68
}
69
69
70
+ def backendId_to_backendIP = [:]
71
+ def backendId_to_backendHttpPort = [:]
72
+ def backendId_to_params = [string :[:]]
73
+
74
+ getBackendIpHttpPort(backendId_to_backendIP, backendId_to_backendHttpPort);
75
+
76
+ def set_be_param = { paramName , paramValue ->
77
+ // for eache be node, set paramName=paramValue
78
+ for (String id in backendId_to_backendIP. keySet()) {
79
+ def beIp = backendId_to_backendIP. get(id)
80
+ def bePort = backendId_to_backendHttpPort. get(id)
81
+ def (code, out, err) = curl(" POST" , String . format(" http://%s:%s/api/update_config?%s=%s" , beIp, bePort, paramName, paramValue))
82
+ assertTrue (out. contains(" OK" ))
83
+ }
84
+ }
85
+
86
+ def reset_be_param = { paramName ->
87
+ // for eache be node, reset paramName to default
88
+ for (String id in backendId_to_backendIP. keySet()) {
89
+ def beIp = backendId_to_backendIP. get(id)
90
+ def bePort = backendId_to_backendHttpPort. get(id)
91
+ def original_value = backendId_to_params. get(id). get(paramName)
92
+ def (code, out, err) = curl(" POST" , String . format(" http://%s:%s/api/update_config?%s=%s" , beIp, bePort, paramName, original_value))
93
+ assertTrue (out. contains(" OK" ))
94
+ }
95
+ }
96
+
97
+ def get_be_param = { paramName ->
98
+ // for eache be node, get param value by default
99
+ def paramValue = " "
100
+ for (String id in backendId_to_backendIP. keySet()) {
101
+ def beIp = backendId_to_backendIP. get(id)
102
+ def bePort = backendId_to_backendHttpPort. get(id)
103
+ // get the config value from be
104
+ def (code, out, err) = curl(" GET" , String . format(" http://%s:%s/api/show_config?conf_item=%s" , beIp, bePort, paramName))
105
+ assertTrue (code == 0 )
106
+ assertTrue (out. contains(paramName))
107
+ // parsing
108
+ def resultList = parseJson(out)[0 ]
109
+ assertTrue (resultList. size() == 4 )
110
+ // get original value
111
+ paramValue = resultList[2 ]
112
+ backendId_to_params. get(id, [:]). put(paramName, paramValue)
113
+ }
114
+ }
115
+
70
116
def load_with_injection = { injection , expect_errmsg ->
71
117
try {
72
118
GetDebugPoint (). enableDebugPointForAllBEs(injection)
@@ -110,10 +156,21 @@ suite("load_stream_fault_injection", "nonConcurrent") {
110
156
// LoadStream add_segment meet unknown segid in request header
111
157
load_with_injection(" TabletStream.add_segment.unknown_segid" , " " )
112
158
// LoadStream append_data meet unknown index id in request header
113
- load_with_injection(" abletStream.add_segment .unknown_indexid" , " " )
159
+ load_with_injection(" TabletStream._append_data .unknown_indexid" , " " )
114
160
// LoadStream dispatch meet unknown load id
115
161
load_with_injection(" LoadStream._dispatch.unknown_loadid" , " " )
116
162
// LoadStream dispatch meet unknown src id
117
163
load_with_injection(" LoadStream._dispatch.unknown_srcid" , " " )
164
+
165
+ // LoadStream meets StreamRPC idle timeout
166
+ get_be_param(" load_stream_idle_timeout_ms" )
167
+ set_be_param(" load_stream_idle_timeout_ms" , 500 )
168
+ try {
169
+ load_with_injection(" LoadStreamStub._send_with_retry.delay_before_send" , " " )
170
+ } catch (Exception e) {
171
+ logger. info(e. getMessage())
172
+ } finally {
173
+ reset_be_param(" load_stream_idle_timeout_ms" )
174
+ }
118
175
}
119
176
0 commit comments