Kaynağa Gözat

Increase number of iterations in shuttle (#8027)

Lucas Ste 2 ay önce
ebeveyn
işleme
5b5fce30b9
2 değiştirilmiş dosya ile 7 ekleme ve 5 silme
  1. 1 1
      ci/test-shuttle.sh
  2. 6 4
      svm/tests/concurrent_tests.rs

+ 1 - 1
ci/test-shuttle.sh

@@ -4,4 +4,4 @@ set -eo pipefail
 
 source ci/_
 
-cargo nextest run --profile ci  --manifest-path="svm/Cargo.toml" --features="shuttle-test" --test concurrent_tests --jobs 1
+cargo nextest run --profile ci  --manifest-path="svm/Cargo.toml" --features="shuttle-test" --test concurrent_tests --release --jobs 1

+ 6 - 4
svm/tests/concurrent_tests.rs

@@ -33,6 +33,8 @@ use {
 
 mod mock_bank;
 
+const MAX_ITERATIONS: usize = 10_000;
+
 fn program_cache_execution(threads: usize) {
     let mut mock_bank = MockBankCallback::default();
     let fork_graph = Arc::new(RwLock::new(MockForkGraph {}));
@@ -111,7 +113,7 @@ fn test_program_cache_with_probabilistic_scheduler() {
         move || {
             program_cache_execution(4);
         },
-        300,
+        MAX_ITERATIONS,
         5,
     );
 }
@@ -119,7 +121,7 @@ fn test_program_cache_with_probabilistic_scheduler() {
 // In this case, the scheduler is random and may preempt threads at any point and any time.
 #[test]
 fn test_program_cache_with_random_scheduler() {
-    shuttle::check_random(move || program_cache_execution(4), 300);
+    shuttle::check_random(move || program_cache_execution(4), MAX_ITERATIONS);
 }
 
 // This test explores all the possible thread scheduling patterns that might affect the program
@@ -130,7 +132,7 @@ fn test_program_cache_with_exhaustive_scheduler() {
     // values in a thread.
     // Since this is not the case for the execution of jitted program, we can still run the test
     // but with decreased accuracy.
-    let scheduler = shuttle::scheduler::DfsScheduler::new(Some(500), true);
+    let scheduler = shuttle::scheduler::DfsScheduler::new(Some(MAX_ITERATIONS), true);
     let runner = Runner::new(scheduler, Default::default());
     runner.run(move || program_cache_execution(4));
 }
@@ -300,7 +302,7 @@ fn test_svm_with_probabilistic_scheduler() {
         move || {
             svm_concurrent();
         },
-        300,
+        MAX_ITERATIONS,
         5,
     );
 }