diff options
| author | Aram Drevekenin <aram@poor.dev> | 2025-10-21 14:36:30 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-10-21 14:36:30 +0200 |
| commit | 889bd06f447f9d50ee46b8efc7d9970d3693cb96 (patch) | |
| tree | 171fa657faccf4b4ce7124847977626826a2a750 /zellij-server/src/plugins/unit/plugin_tests.rs | |
| parent | Give plugins the ability to read pane contents (#4465) (diff) | |
| download | sl0ppij-889bd06f447f9d50ee46b8efc7d9970d3693cb96.tar.gz sl0ppij-889bd06f447f9d50ee46b8efc7d9970d3693cb96.tar.xz sl0ppij-889bd06f447f9d50ee46b8efc7d9970d3693cb96.zip | |
Migrate from wasmtime to wasmi (#4449)
* initial implementation
* fix stdio and host folder mounting
* some memory usage optimizations
* fix plugin tests
* remove unused plugin cache
* fix docker-compose for e2e tests when running locally
* rustfmt
* initial pinned executor implementation
* EXPERIMENT: add jemalloc
* initial dynamic pinned threadpool
* cleanups and experiments
* keep state on execution threads
* reintroduce memory cache
* add wasmi engine to executor threads
* load plugins for new clients on the relevant executor thread
* only show loading indication of loading for more than 0.4 secs
* fix anonymous plugin loading without client id
* refactor lots of stuff
* update snapshots
* tests for pinned executor
* remove jemalloc
* fix stderr from plugins
* cleanups
* rustfmt
* cleanups
* fix endless loading for additinal attachments
* more cleanups
* remove singlepass feature
* fix displaying plugin permission message
* render optimizations
* always render for tests
* rustfmt
* optimize release build for wasmi
* fixes for multiple client plugin loading
* fix frame rendering for multiple clients
* rustfmt
* fix loading background plugins and e2e event ordering change
* rustfmt
* account for races in the pin_floating_panes e2e test
* docs(changelog): add PR
Diffstat (limited to 'zellij-server/src/plugins/unit/plugin_tests.rs')
| -rw-r--r-- | zellij-server/src/plugins/unit/plugin_tests.rs | 30 |
1 files changed, 21 insertions, 9 deletions
diff --git a/zellij-server/src/plugins/unit/plugin_tests.rs b/zellij-server/src/plugins/unit/plugin_tests.rs index da725443..9631da91 100644 --- a/zellij-server/src/plugins/unit/plugin_tests.rs +++ b/zellij-server/src/plugins/unit/plugin_tests.rs @@ -6,7 +6,7 @@ use lazy_static::lazy_static; use std::collections::BTreeMap; use std::path::PathBuf; use tempfile::tempdir; -use wasmtime::Engine; +use wasmi::Engine; use zellij_utils::data::{ BareKey, Event, InputMode, KeyWithModifier, PermissionStatus, PermissionType, PluginCapabilities, @@ -333,7 +333,10 @@ fn create_plugin_thread( None, ) .should_silently_fail(); - let engine = Engine::new(wasmtime::Config::new().strategy(wasmtime::Strategy::Winch)).unwrap(); + let mut config = wasmi::Config::default(); + config.set_max_stack_height(1024 * 1024); + config.set_max_recursion_depth(1000); + let engine = Engine::new(&config); let data_dir = PathBuf::from(tempdir().unwrap().path()); let default_shell = PathBuf::from("."); let plugin_capabilities = PluginCapabilities::default(); @@ -427,7 +430,10 @@ fn create_plugin_thread_with_server_receiver( None, ) .should_silently_fail(); - let engine = Engine::new(wasmtime::Config::new().strategy(wasmtime::Strategy::Winch)).unwrap(); + let mut config = wasmi::Config::default(); + config.set_max_stack_height(1024 * 1024); + config.set_max_recursion_depth(1000); + let engine = Engine::new(&config); let data_dir = PathBuf::from(tempdir().unwrap().path()); let default_shell = PathBuf::from("."); let plugin_capabilities = PluginCapabilities::default(); @@ -517,7 +523,10 @@ fn create_plugin_thread_with_pty_receiver( None, ) .should_silently_fail(); - let engine = Engine::new(wasmtime::Config::new().strategy(wasmtime::Strategy::Winch)).unwrap(); + let mut config = wasmi::Config::default(); + config.set_max_stack_height(1024 * 1024); + config.set_max_recursion_depth(1000); + let engine = Engine::new(&config); let data_dir = PathBuf::from(tempdir().unwrap().path()); let default_shell = PathBuf::from("."); let plugin_capabilities = PluginCapabilities::default(); @@ -602,7 +611,10 @@ fn create_plugin_thread_with_background_jobs_receiver( None, ) .should_silently_fail(); - let engine = Engine::new(wasmtime::Config::new().strategy(wasmtime::Strategy::Winch)).unwrap(); + let mut config = wasmi::Config::default(); + config.set_max_stack_height(1024 * 1024); + config.set_max_recursion_depth(1000); + let engine = Engine::new(&config); let data_dir = PathBuf::from(tempdir().unwrap().path()); let default_shell = PathBuf::from("."); let plugin_capabilities = PluginCapabilities::default(); @@ -8666,7 +8678,7 @@ pub fn reload_plugin_plugin_command() { received_screen_instructions, ScreenInstruction::RequestStateUpdateForPlugins, // happens on successful plugin (re)load screen_receiver, - 3, + 2, &PermissionType::ChangeApplicationState, cache_path, plugin_thread_sender, @@ -8709,7 +8721,7 @@ pub fn reload_plugin_plugin_command() { } }) .count(); - assert_eq!(request_state_update_requests, 3); + assert_eq!(request_state_update_requests, 2); } #[test] @@ -8740,7 +8752,7 @@ pub fn load_new_plugin_plugin_command() { received_screen_instructions, ScreenInstruction::RequestStateUpdateForPlugins, // happens on successful plugin (re)load screen_receiver, - 3, + 2, &PermissionType::ChangeApplicationState, cache_path, plugin_thread_sender, @@ -8783,7 +8795,7 @@ pub fn load_new_plugin_plugin_command() { } }) .count(); - assert_eq!(request_state_update_requests, 3); + assert_eq!(request_state_update_requests, 2); } #[test] |
