arc: Add arc.BootForever test. This test repeatedly boots ARC (almost) forever. It is supposed to be used to reproduce ARC boot flakiness issues, so it is disabled by default. BUG=chromium:865213 TEST=tast -verboser run DUT arc.BootForever Change-Id: I37a2b2388fda399693740d62c875138daced1f94 Reviewed-on: https://chromium-review.googlesource.com/1143118 Commit-Ready: Shuhei Takahashi <nya@chromium.org> Tested-by: Shuhei Takahashi <nya@chromium.org> Reviewed-by: Shuhei Takahashi <nya@chromium.org>
diff --git a/src/chromiumos/tast/local/bundles/cros/arc/boot_forever.go b/src/chromiumos/tast/local/bundles/cros/arc/boot_forever.go new file mode 100644 index 0000000..529c56eb --- /dev/null +++ b/src/chromiumos/tast/local/bundles/cros/arc/boot_forever.go
@@ -0,0 +1,50 @@ +// Copyright 2018 The Chromium OS Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +package arc + +import ( + "context" + "time" + + "chromiumos/tast/local/arc" + "chromiumos/tast/local/chrome" + "chromiumos/tast/testing" +) + +func init() { + testing.AddTest(&testing.Test{ + Func: BootForever, + Desc: "Checks that Android boots repeatedly", + Attr: []string{"disabled"}, + SoftwareDeps: []string{"android", "chrome_login"}, + Timeout: 365 * 24 * time.Hour, + }) +} + +func BootForever(s *testing.State) { + iter := func() { + ctx, cancel := context.WithTimeout(s.Context(), 2*time.Minute) + defer cancel() + + cr, err := chrome.New(ctx) + if err != nil { + s.Fatal("Failed to connect to Chrome: ", err) + } + defer cr.Close(ctx) + + a, err := arc.New(ctx, cr, s.OutDir()) + if err != nil { + s.Fatal("Failed to start ARC: ", err) + } + defer a.Close() + + // Skip further sanity checks to speed up iterations. + } + + for i := 0; ; i++ { + s.Log("======= Iteration ", i+1) + iter() + } +}