Skip to content

Commit 53a4096

Browse files
authored
Don't run FS.createLazyFile tests in WasmFS mode (#19609)
This uses a new decorator to make sure the test runs without WasmFS. That will unblock us from turning WasmFS on by default (without such annotations, the test would start to fail once WasmFS was on).
1 parent 52253a0 commit 53a4096

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

test/test_browser.py

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,27 @@ def metafunc(self, wasmfs, *args, **kwargs):
9292
return metafunc
9393

9494

95+
# This is similar to @core.no_wasmfs, but it disable WasmFS and runs the test
96+
# normally. That is, in core we skip the test if we are in the wasmfs.* mode,
97+
# while in browser we don't have such modes, so we force the test to run without
98+
# WasmFS.
99+
#
100+
# When WasmFS is on by default, these annotations will still be needed. Only
101+
# when we remove the old JS FS entirely would we remove them.
102+
def no_wasmfs(note):
103+
assert not callable(note)
104+
105+
def decorator(f):
106+
assert callable(f)
107+
108+
@wraps(f)
109+
def decorated(self, *args, **kwargs):
110+
self.set_setting('WASMFS', 0)
111+
f(self, *args, **kwargs)
112+
return decorated
113+
return decorator
114+
115+
95116
def also_with_wasm2js(f):
96117
assert callable(f)
97118

@@ -1656,6 +1677,7 @@ def test_worker(self):
16561677

16571678
self.assertContained('you should not see this text when in a worker!', self.run_js('worker.js')) # code should run standalone too
16581679

1680+
@no_wasmfs('https://github.com/emscripten-core/emscripten/issues/19608')
16591681
def test_mmap_lazyfile(self):
16601682
create_file('lazydata.dat', 'hello world')
16611683
create_file('pre.js', '''
@@ -1666,6 +1688,7 @@ def test_mmap_lazyfile(self):
16661688
self.emcc_args += ['--pre-js=pre.js', '--proxy-to-worker']
16671689
self.btest_exit(test_file('test_mmap_lazyfile.c'))
16681690

1691+
@no_wasmfs('https://github.com/emscripten-core/emscripten/issues/19608')
16691692
@no_firefox('keeps sending OPTIONS requests, and eventually errors')
16701693
def test_chunked_synchronous_xhr(self):
16711694
main = 'chunked_sync_xhr.html'

0 commit comments

Comments
 (0)