summaryrefslogtreecommitdiffhomepage
path: root/test/util
diff options
context:
space:
mode:
authorAdin Scannell <ascannell@google.com>2021-04-13 15:40:41 -0700
committergVisor bot <gvisor-bot@google.com>2021-04-13 15:42:41 -0700
commite83cc06f1b79dcbae3a0217384985ab32138ca9a (patch)
tree472f5bb0923bfa16513d6b567a654fa6f3a29b24 /test/util
parent326394b79a62061e3e239ac104c151ca13647439 (diff)
Remove _NoRandomSave tests.
We do not currently run random save tests. PiperOrigin-RevId: 368309921
Diffstat (limited to 'test/util')
-rw-r--r--test/util/save_util.cc26
1 files changed, 7 insertions, 19 deletions
diff --git a/test/util/save_util.cc b/test/util/save_util.cc
index 59d47e06e..3e724d99b 100644
--- a/test/util/save_util.cc
+++ b/test/util/save_util.cc
@@ -27,23 +27,13 @@ namespace gvisor {
namespace testing {
namespace {
-std::atomic<absl::optional<bool>> cooperative_save_present;
-std::atomic<absl::optional<bool>> random_save_present;
+std::atomic<absl::optional<bool>> save_present;
-bool CooperativeSavePresent() {
- auto present = cooperative_save_present.load();
+bool SavePresent() {
+ auto present = save_present.load();
if (!present.has_value()) {
- present = getenv("GVISOR_COOPERATIVE_SAVE_TEST") != nullptr;
- cooperative_save_present.store(present);
- }
- return present.value();
-}
-
-bool RandomSavePresent() {
- auto present = random_save_present.load();
- if (!present.has_value()) {
- present = getenv("GVISOR_RANDOM_SAVE_TEST") != nullptr;
- random_save_present.store(present);
+ present = getenv("GVISOR_SAVE_TEST") != nullptr;
+ save_present.store(present);
}
return present.value();
}
@@ -52,12 +42,10 @@ std::atomic<int> save_disable;
} // namespace
-bool IsRunningWithSaveRestore() {
- return CooperativeSavePresent() || RandomSavePresent();
-}
+bool IsRunningWithSaveRestore() { return SavePresent(); }
void MaybeSave() {
- if (CooperativeSavePresent() && save_disable.load() == 0) {
+ if (SavePresent() && save_disable.load() == 0) {
internal::DoCooperativeSave();
}
}