Skip to content

Commit

Permalink
roachtest : add --use-spot option
Browse files Browse the repository at this point in the history
This options enables use of SpotVM to run tests, If the provider does not support spotVM, it will be ignored
  • Loading branch information
BabuSrithar committed Dec 13, 2023
1 parent 5774ee0 commit cf685c9
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
6 changes: 6 additions & 0 deletions pkg/cmd/roachtest/roachtestflags/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -304,6 +304,12 @@ var (
run at least one test per prefix.`,
})

UseSpotVM bool
_ = registerRunFlag(&UseSpotVM, FlagInfo{
Name: "use-spot",
Usage: `Use SpotVM to run tests, If the provider does not support spotVM, it will be ignored`,
})

GlobalSeed int64 = randutil.NewPseudoSeed()
_ = registerRunFlag(&GlobalSeed, FlagInfo{
Name: "global-seed",
Expand Down
4 changes: 4 additions & 0 deletions pkg/cmd/roachtest/test_runner.go
Original file line number Diff line number Diff line change
Expand Up @@ -648,6 +648,10 @@ func (r *testRunner) runWorker(
}
}

if roachtestflags.UseSpotVM {
testToRun.spec.Cluster.UseSpotVMs = true
}

// Verify that required native libraries are available.
//
// TODO(radu): the arch is not guaranteed and another arch can be selected
Expand Down

0 comments on commit cf685c9

Please sign in to comment.