6260: Expose queue sizes in /status.json. Fix sleep/race in trash_worker_test.
[arvados.git] / services / keepstore / status_test.go
diff --git a/services/keepstore/status_test.go b/services/keepstore/status_test.go
new file mode 100644 (file)
index 0000000..134b016
--- /dev/null
@@ -0,0 +1,15 @@
+package main
+
+import (
+       "encoding/json"
+)
+
+func getStatusItem(keys ...string) interface{} {
+       resp := IssueRequest(&RequestTester{"/status.json", "", "GET", nil})
+       var s interface{}
+       json.NewDecoder(resp.Body).Decode(&s)
+       for _, k := range keys {
+               s = s.(map[string]interface{})[k]
+       }
+       return s
+}