diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 64e778be9..35c55d4c6 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -155,39 +155,6 @@ jobs: --artifacts target/artifacts \ --rust-wit-bindgen-path ./crates/guest-rust - # While threading is off-by-default and toolchains are percolating this is a - # separate job to get configured slightly differently. - threading: - name: Test WASIp3 Threading (allowed to fail) - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - with: - submodules: true - - - name: Install Rust - run: rustup update stable --no-self-update && rustup default stable - - run: rustup target add wasm32-wasip2 - - - uses: ./.github/actions/install-wasi-sdk - - # The threading builtins are encoded with a canonical-function opcode - # newer than any released wasmtime understands (46.0.1 and 47.0.2 both - # reject it with "invalid leading byte (0x2d) for canonical function"), - # so this job runs wasmtime's `dev` build instead of the pinned release. - # This can go back to the shared pin once a release parses the encoding. - - name: Install wasmtime dev build - run: | - curl --retry 5 --retry-all-errors -L -o wasmtime-dev.tar.xz https://github.com/bytecodealliance/wasmtime/releases/download/dev/wasmtime-dev-x86_64-linux.tar.xz - tar xJf wasmtime-dev.tar.xz - echo "`pwd`/wasmtime-dev-x86_64-linux" >> $GITHUB_PATH - working-directory: ${{ runner.temp }} - - - run: | - cargo run test --languages rust,c,go tests/threading \ - --artifacts target/artifacts \ - --rust-wit-bindgen-path ./crates/guest-rust - test_unit: name: Crate Unit Tests runs-on: ubuntu-latest diff --git a/tests/threading/threading-builtins/runner.c b/tests/threading/threading-builtins/runner.c deleted file mode 100644 index ab4805c8f..000000000 --- a/tests/threading/threading-builtins/runner.c +++ /dev/null @@ -1,22 +0,0 @@ -//@ args = '--rename a:b/i=test --async=-run' -//@ wasmtime-flags = '-Wcomponent-model-async -Wcomponent-model-threading -Wcomponent-model-async-stackful' - -#include -#include - -void exports_runner_run() -{ - runner_subtask_status_t status = test_f(); - assert(RUNNER_SUBTASK_STATE(status) == RUNNER_SUBTASK_STARTED); - runner_subtask_t task = RUNNER_SUBTASK_HANDLE(status); - - runner_waitable_set_t set = runner_waitable_set_new(); - runner_waitable_join(task, set); - runner_event_t event; - runner_waitable_set_wait(set, &event); - assert(event.event == RUNNER_EVENT_SUBTASK); - assert(event.waitable == task); - assert(event.code == RUNNER_SUBTASK_RETURNED); - runner_waitable_join(task, 0); - runner_waitable_set_drop(set); -} diff --git a/tests/threading/threading-builtins/test.c b/tests/threading/threading-builtins/test.c deleted file mode 100644 index b9baa2092..000000000 --- a/tests/threading/threading-builtins/test.c +++ /dev/null @@ -1,57 +0,0 @@ -//@ args = '--rename a:b/i=test --generate-threading-helpers' -//@ [lang] -//@ cflags = "-O2" -//@ ldflags = "-Wl,--export-table" - -#include -#include -#include - -test_subtask_status_t exports_test_f() { return TEST_CALLBACK_CODE_YIELD; } - -uint32_t main_tid = 0; -uint32_t spawned_tid = 0; - -void thread_start(void *arg) { - // Call all the threading builtins; the main thread will do the right thing - // to resume us. - test_thread_yield(); - test_thread_yield_cancellable(); - test_thread_suspend(); - test_thread_suspend_cancellable(); - test_thread_yield_then_resume(main_tid); - test_thread_yield_then_resume_cancellable(main_tid); - test_thread_yield_then_promote(main_tid); - test_thread_yield_then_promote_cancellable(main_tid); - test_thread_suspend_then_resume(main_tid); - test_thread_suspend_then_resume_cancellable(main_tid); - test_thread_suspend_then_promote(main_tid); - test_thread_suspend_then_promote_cancellable(main_tid); - test_thread_resume_later(main_tid); -} - -test_subtask_status_t exports_test_f_callback(test_event_t *event) { - assert(event->event == TEST_EVENT_NONE); - assert(event->waitable == 0); - assert(event->code == 0); - main_tid = test_thread_index(); - spawned_tid = test_thread_new_indirect(thread_start, &main_tid); - - // Now drive the other thread to completion by switching/yielding to it - test_thread_yield_then_resume(spawned_tid); // other yields - test_thread_yield(); // other yields - test_thread_yield(); // other suspends - test_thread_yield_then_resume(spawned_tid); // other suspends - test_thread_suspend_then_resume(spawned_tid); // other yields to me - test_thread_suspend(); // other yields to me - test_thread_suspend(); // other yields to me - test_thread_suspend(); // other yields to me - test_thread_suspend(); // other suspends to me - test_thread_suspend_then_resume(spawned_tid); // other suspends to me - test_thread_suspend_then_resume(spawned_tid); // other suspends to me - test_thread_suspend_then_resume(spawned_tid); // other suspends to me - test_thread_suspend_then_resume( - spawned_tid); // other unsuspends me and terminates - exports_test_f_return(); - return TEST_CALLBACK_CODE_EXIT; -} diff --git a/tests/threading/threading-builtins/test.wit b/tests/threading/threading-builtins/test.wit deleted file mode 100644 index 378d915eb..000000000 --- a/tests/threading/threading-builtins/test.wit +++ /dev/null @@ -1,15 +0,0 @@ -package a:b; - -interface i { - f: async func(); -} - -world test { - export i; -} - -world runner { - import i; - - export run: async func(); -}