diff options
| author | Aleksandr Nogikh <nogikh@google.com> | 2025-10-09 13:08:08 +0200 |
|---|---|---|
| committer | Aleksandr Nogikh <nogikh@google.com> | 2025-10-17 07:26:38 +0000 |
| commit | 7adf52984df180ab9bc8140d49aabc0d29a1b635 (patch) | |
| tree | e2ee9c0ae0cc3e584b92005dc9156042ee249b33 | |
| parent | 03f955c333876a30a020002473aa2bda3c123681 (diff) | |
syz-cluster: extend dashboard testing
Check a few more URLs.
Add a TODO about the problem around template error handling - if we
stream the output directly to w, we cannot set the 500 status if a
problem happens somewhere mid-template.
| -rw-r--r-- | syz-cluster/dashboard/handler.go | 3 | ||||
| -rw-r--r-- | syz-cluster/dashboard/handler_test.go | 6 |
2 files changed, 8 insertions, 1 deletions
diff --git a/syz-cluster/dashboard/handler.go b/syz-cluster/dashboard/handler.go index 58edd5c39..42fad9bbe 100644 --- a/syz-cluster/dashboard/handler.go +++ b/syz-cluster/dashboard/handler.go @@ -393,6 +393,9 @@ func errToStatus(f func(http.ResponseWriter, *http.Request) error) http.HandlerF } else if errors.Is(err, errBadRequest) { http.Error(w, err.Error(), http.StatusBadRequest) } else if err != nil { + // TODO: if the error happened in the template, likely we've already printed + // something to w. Unless we're in streamBlob(), it makes sense to first collect + // the output in some buffer and only dump it after the exit from the handler. http.Error(w, err.Error(), http.StatusInternalServerError) } } diff --git a/syz-cluster/dashboard/handler_test.go b/syz-cluster/dashboard/handler_test.go index a1200582e..8bdb5c318 100644 --- a/syz-cluster/dashboard/handler_test.go +++ b/syz-cluster/dashboard/handler_test.go @@ -26,7 +26,11 @@ func TestURLs(t *testing.T) { handler, baseURL := testServer(t, env) urlGen := api.NewURLGenerator(baseURL) - urls := []string{urlGen.Series(ids.SeriesID)} + urls := []string{ + baseURL, + baseURL + "/stats", + urlGen.Series(ids.SeriesID), + } for _, buildID := range []string{ids.BaseBuildID, ids.PatchedBuildID} { urls = append(urls, urlGen.BuildConfig(buildID)) urls = append(urls, urlGen.BuildLog(buildID)) |
