Skip to content

Commit 1dfed8a

Browse files
committed
fix misc_testsuite test regressions
This amounts to adding `async` to any exported component functions that might need to block. Signed-off-by: Joel Dice <[email protected]>
1 parent 30f47e2 commit 1dfed8a

13 files changed

+30
-30
lines changed

tests/misc_testsuite/component-model-threading/many-threads-indexed.wast

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,6 @@
121121
(with "libc" (instance $libc))))
122122

123123
;; Export the main entry point
124-
(func (export "run") (result u32) (canon lift (core func $i "run"))))
124+
(func (export "run") async (result u32) (canon lift (core func $i "run"))))
125125

126126
(assert_return (invoke "run") (u32.const 42))

tests/misc_testsuite/component-model-threading/stackful-cancellation.wast

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -223,17 +223,17 @@
223223
(with "libc" (instance $libc))))
224224

225225
(func (export "run-yield") (result u32) (canon lift (core func $cm "run-yield") async))
226-
(func (export "run-yield-to") (param "fut" $FT) (result u32) (canon lift (core func $cm "run-yield-to") async))
227-
(func (export "run-suspend") (param "fut" $FT) (result u32) (canon lift (core func $cm "run-suspend") async))
228-
(func (export "run-switch-to") (param "fut" $FT) (result u32) (canon lift (core func $cm "run-switch-to") async))
226+
(func (export "run-yield-to") async (param "fut" $FT) (result u32) (canon lift (core func $cm "run-yield-to") async))
227+
(func (export "run-suspend") async (param "fut" $FT) (result u32) (canon lift (core func $cm "run-suspend") async))
228+
(func (export "run-switch-to") async (param "fut" $FT) (result u32) (canon lift (core func $cm "run-switch-to") async))
229229
)
230230

231231
(component $D
232232
(type $FT (future))
233233
(import "run-yield" (func $run-yield (result u32)))
234-
(import "run-yield-to" (func $run-yield-to (param "fut" $FT) (result u32)))
235-
(import "run-suspend" (func $run-suspend (param "fut" $FT) (result u32)))
236-
(import "run-switch-to" (func $run-switch-to (param "fut" $FT) (result u32)))
234+
(import "run-yield-to" (func $run-yield-to async (param "fut" $FT) (result u32)))
235+
(import "run-suspend" (func $run-suspend async (param "fut" $FT) (result u32)))
236+
(import "run-switch-to" (func $run-switch-to async (param "fut" $FT) (result u32)))
237237

238238
(core module $Memory (memory (export "mem") 1))
239239
(core instance $memory (instantiate $Memory))
@@ -369,7 +369,7 @@
369369
(export "future.write" (func $future.write))
370370
(export "thread.yield" (func $thread.yield))
371371
))))
372-
(func (export "run") (result u32) (canon lift (core func $dm "run")))
372+
(func (export "run") async (result u32) (canon lift (core func $dm "run")))
373373
)
374374

375375
(instance $c (instantiate $C))

tests/misc_testsuite/component-model-threading/threading-builtins.wast

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,6 @@
9797
(with "libc" (instance $libc))))
9898

9999
;; Export the main entry point
100-
(func (export "run") (result u32) (canon lift (core func $i "run"))))
100+
(func (export "run") async (result u32) (canon lift (core func $i "run"))))
101101

102102
(assert_return (invoke "run") (u32.const 42))

tests/misc_testsuite/component-model/async/backpressure-deadlock.wast

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@
9191
))
9292
))
9393

94-
(func (export "f") (canon lift (core func $i "f")))
94+
(func (export "f") async (canon lift (core func $i "f")))
9595
)
9696

9797
(assert_trap (invoke "f") "deadlock detected")

tests/misc_testsuite/component-model/async/future-cancel-read-dropped.wast

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@
5858
))
5959
))
6060

61-
(func (export "f") (result u32) (canon lift (core func $i "f")))
61+
(func (export "f") async (result u32) (canon lift (core func $i "f")))
6262
)
6363

6464
;; Note that there's no way for `future.read` to return DROPPED since the write

tests/misc_testsuite/component-model/async/future-cancel-write-completed.wast

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@
9090
))
9191
))
9292

93-
(func (export "f") (result u32) (canon lift (core func $i "f")))
93+
(func (export "f") async (result u32) (canon lift (core func $i "f")))
9494
)
9595

9696
(assert_return (invoke "f") (u32.const 0))

tests/misc_testsuite/component-model/async/future-cancel-write-dropped.wast

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151
))
5252
))
5353

54-
(func (export "f") (result u32) (canon lift (core func $i "f")))
54+
(func (export "f") async (result u32) (canon lift (core func $i "f")))
5555
)
5656

5757
(assert_return (invoke "f") (u32.const 1)) ;; expect DROPPED status (not CANCELLED)

tests/misc_testsuite/component-model/async/future-read.wast

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949
))
5050
))
5151

52-
(func (export "run")
52+
(func (export "run") async
5353
(canon lift (core func $i "run")))
5454
)
5555

@@ -134,7 +134,7 @@
134134
(export "read" (func $read))
135135
))
136136
))
137-
(func (export "run") (param "x" $future)
137+
(func (export "run") async (param "x" $future)
138138
(canon lift (core func $i "run") async (callback (func $i "cb"))))
139139
)
140140
(instance $child (instantiate $child))
@@ -158,7 +158,7 @@
158158
))
159159
))
160160

161-
(func (export "run")
161+
(func (export "run") async
162162
(canon lift (core func $i "run")))
163163
)
164164

@@ -219,7 +219,7 @@
219219
))
220220
))
221221

222-
(func (export "run")
222+
(func (export "run") async
223223
(canon lift (core func $i "run")))
224224
)
225225

tests/misc_testsuite/component-model/async/partial-stream-copies.wast

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@
234234
(export "stream.drop-writable" (func $stream.drop-writable))
235235
(export "transform" (func $transform'))
236236
))))
237-
(func (export "run") (result u32) (canon lift (core func $dm "run")))
237+
(func (export "run") async (result u32) (canon lift (core func $dm "run")))
238238
)
239239

240240
(instance $c (instantiate $C))

tests/misc_testsuite/component-model/async/subtask-wait.wast

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,11 @@
1717
)
1818

1919
(core instance $a (instantiate $a))
20-
(func (export "run")
20+
(func (export "run") async
2121
(canon lift (core func $a "run") async (callback (func $a "run-cb"))))
2222
)
2323
(component $B
24-
(import "a" (instance $a (export "run" (func))))
24+
(import "a" (instance $a (export "run" (func async))))
2525

2626
(core module $libc (memory (export "memory") 1))
2727
(core instance $libc (instantiate $libc))
@@ -71,7 +71,7 @@
7171
(export "wait" (func $wait))
7272
))
7373
))
74-
(func (export "run")
74+
(func (export "run") async
7575
(canon lift (core func $b "run")))
7676
)
7777

0 commit comments

Comments
 (0)