Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion src/pkg/dashboard/api_event_triggers_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,14 @@ func TestEventTriggersRejectInvalidAndUnpersistedRules(t *testing.T) {
t.Fatalf("failed persistence accepted: %d %s", failed.Code, failed.Body.String())
}
cfg.SourcePath = t.TempDir()
config.RuntimeConfigFile, config.DashboardOverlayFile = t.TempDir(), t.TempDir()
// Every layer must fail regardless of test order. An empty directory is
// not enough for the runtime path: saveLocked removes it and retries
// (the root-owned-file recovery), and the retry succeeds. A file under
// a directory that does not exist fails the write, the remove and the
// retry alike.
missingDir := filepath.Join(t.TempDir(), "missing")
config.RuntimeConfigFile = filepath.Join(missingDir, "hive.yaml.runtime")
config.DashboardOverlayFile = filepath.Join(missingDir, "dashboard-overlay.yaml")
failed = putEventTriggers(s, `{"rules":[]}`, version)
if failed.Code != http.StatusInternalServerError || !reflect.DeepEqual(cfg.TriggerRulesSnapshot(), before) ||
strings.Contains(failed.Body.String(), cfg.SourcePath) {
Expand Down
Loading