Skip to content

Commit

Permalink
[fix] Add done --> ready transition for unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
georgemitenkov committed Nov 12, 2024
1 parent 03a1ea2 commit 28116bc
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -136,13 +136,16 @@ impl<S: StateView + Sync + Send + 'static> ShardedExecutorService<S> {
);
});
s.spawn(move |_| {
// Since we execute blocks in parallel, we cannot share module caches, so each
// thread has its own caches.
let module_cache_manager = ModuleCacheManager::new();
module_cache_manager.mark_ready(None, None);

let ret = BlockAptosVM::execute_block_on_thread_pool(
executor_thread_pool,
&signature_verified_transactions,
aggr_overridden_state_view.as_ref(),
// Since we execute blocks in parallel, we cannot share module caches, so each
// thread has its own caches.
&ModuleCacheManager::new(),
&module_cache_manager,
config,
cross_shard_commit_sender,
)
Expand Down
8 changes: 6 additions & 2 deletions aptos-move/e2e-tests/src/executor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -640,15 +640,19 @@ impl FakeExecutor {
},
onchain: onchain_config,
};

// Do not use shared module caches in tests.
let module_cache_manager = ModuleCacheManager::new();
module_cache_manager.mark_ready(None, None);

BlockAptosVM::execute_block_on_thread_pool::<
_,
NoOpTransactionCommitHook<AptosTransactionOutput, VMStatus>,
>(
self.executor_thread_pool.clone(),
txn_block,
&state_view,
// Do not use shared module caches in tests.
&ModuleCacheManager::new(),
&module_cache_manager,
config,
None,
)
Expand Down
2 changes: 1 addition & 1 deletion execution/executor/src/db_bootstrapper/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ pub fn calculate_genesis<V: VMBlockExecutor>(
}

let execution_output = DoGetExecutionOutput::by_transaction_execution::<V>(
&V::new(),
&executor,
vec![genesis_txn.clone().into()].into(),
base_state_view,
BlockExecutorConfigFromOnchain::new_no_block_limit(),
Expand Down

0 comments on commit 28116bc

Please sign in to comment.