|
@@ -33,6 +33,8 @@ use {
|
|
|
|
|
|
|
|
mod mock_bank;
|
|
mod mock_bank;
|
|
|
|
|
|
|
|
|
|
+const MAX_ITERATIONS: usize = 10_000;
|
|
|
|
|
+
|
|
|
fn program_cache_execution(threads: usize) {
|
|
fn program_cache_execution(threads: usize) {
|
|
|
let mut mock_bank = MockBankCallback::default();
|
|
let mut mock_bank = MockBankCallback::default();
|
|
|
let fork_graph = Arc::new(RwLock::new(MockForkGraph {}));
|
|
let fork_graph = Arc::new(RwLock::new(MockForkGraph {}));
|
|
@@ -111,7 +113,7 @@ fn test_program_cache_with_probabilistic_scheduler() {
|
|
|
move || {
|
|
move || {
|
|
|
program_cache_execution(4);
|
|
program_cache_execution(4);
|
|
|
},
|
|
},
|
|
|
- 300,
|
|
|
|
|
|
|
+ MAX_ITERATIONS,
|
|
|
5,
|
|
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.
|
|
// In this case, the scheduler is random and may preempt threads at any point and any time.
|
|
|
#[test]
|
|
#[test]
|
|
|
fn test_program_cache_with_random_scheduler() {
|
|
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
|
|
// 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.
|
|
// values in a thread.
|
|
|
// Since this is not the case for the execution of jitted program, we can still run the test
|
|
// Since this is not the case for the execution of jitted program, we can still run the test
|
|
|
// but with decreased accuracy.
|
|
// 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());
|
|
let runner = Runner::new(scheduler, Default::default());
|
|
|
runner.run(move || program_cache_execution(4));
|
|
runner.run(move || program_cache_execution(4));
|
|
|
}
|
|
}
|
|
@@ -300,7 +302,7 @@ fn test_svm_with_probabilistic_scheduler() {
|
|
|
move || {
|
|
move || {
|
|
|
svm_concurrent();
|
|
svm_concurrent();
|
|
|
},
|
|
},
|
|
|
- 300,
|
|
|
|
|
|
|
+ MAX_ITERATIONS,
|
|
|
5,
|
|
5,
|
|
|
);
|
|
);
|
|
|
}
|
|
}
|