19961: Save separate preemptionNotice key in runtime_status.
[arvados.git] / lib / crunchrun / crunchrun_test.go
index 5b4c6827b965feba6456e3f4f47c5d82288a9d64..1f732c051d2fe563188da64f9d03b3bd668e9381 100644 (file)
@@ -848,7 +848,11 @@ func (s *TestSuite) testSpotInterruptionNotice(c *C, failureRate float64) {
        if failureRate == 1 {
                c.Check(s.api.Logs["crunch-run"].String(), Matches, `(?ms).*Giving up on checking spot interruptions after too many consecutive failures.*`)
        } else {
-               c.Check(s.api.Logs["crunch-run"].String(), Matches, `(?ms).*Cloud provider indicates instance action "stop" scheduled for time "`+stoptime.Load().(time.Time).Format(time.RFC3339)+`".*`)
+               text := `Cloud provider indicates instance action "stop" scheduled for time "` + stoptime.Load().(time.Time).Format(time.RFC3339) + `"`
+               c.Check(s.api.Logs["crunch-run"].String(), Matches, `(?ms).*`+text+`.*`)
+               c.Check(s.api.CalledWith("container.runtime_status.warning", "preemption notice"), NotNil)
+               c.Check(s.api.CalledWith("container.runtime_status.warningDetail", text), NotNil)
+               c.Check(s.api.CalledWith("container.runtime_status.preemptionNotice", text), NotNil)
        }
 }