test: add tess for /debug/pprof-mutex/ endpoint
License: MIT Signed-off-by: Jakub Sztandera <kubuxu@protonmail.ch>
Jakub Sztandera committed
Sep 27, 2018 at 03:35 UTC
12746433ea5382a50e3705db6b4ef7207e8fe656
1 file changed
+15
test/sharness/t0110-gateway.sh
+15
@@ -106,6 +106,21 @@ test_expect_success "output only has one transfer encoding header" '
106
test_cmp tecount_out tecount_exp
107
'
108
109
+curl_pprofmutex() {
110
+ curl -f -X POST "http://127.0.0.1:$apiport/debug/pprof-mutex/?fraction=$1"
111
+}
112
+
113
+test_expect_success "set mutex fraction for pprof (negative so it doesn't enable)" '
114
+ curl_pprofmutex -1
115
+'
116
+
117
+test_expect_success "test failure conditions of mutex pprof endpoint" '
118
+ test_must_fail curl_pprofmutex &&
119
+ test_must_fail curl_pprofmutex that_is_string &&
120
+ test_must_fail curl -f -X GET "http://127.0.0.1:$apiport/debug/pprof-mutex/?fraction=-1"
121
+'
122
+
123
+
124
test_expect_success "setup index hash" '
125
mkdir index &&
126
echo "<p></p>" > index/index.html &&