Skip to content

browser.test_wasm_worker_lock_async_acquire is flaky #25270

@juj

Description

@juj

The test seems to be racy to occassionally postMessage() to a Wasm Worker after the test has finished, resulting in

======================================================================
FAIL: test_wasm_worker_lock_async_acquire (test_browser.browser_2gb.test_wasm_worker_lock_async_acquire)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/clb/.pyenv/versions/3.13.3/lib/python3.13/unittest/case.py", line 58, in testPartExecutor
    yield
  File "/home/clb/.pyenv/versions/3.13.3/lib/python3.13/unittest/case.py", line 651, in run
    self._callTestMethod(testMethod)
    ~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^
  File "/home/clb/.pyenv/versions/3.13.3/lib/python3.13/unittest/case.py", line 606, in _callTestMethod
    if method() is not None:
       ~~~~~~^^
  File "/home/clb/buildbot/h12dsi-linux-mint22/emscripten_linux_x64/build/emscripten/main/test/common.py", line 1049, in resulting_test
    return func(self, *args)
  File "/home/clb/buildbot/h12dsi-linux-mint22/emscripten_linux_x64/build/emscripten/main/test/common.py", line 668, in metafunc
    f(self, *args, **kwargs)
    ~^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/clb/buildbot/h12dsi-linux-mint22/emscripten_linux_x64/build/emscripten/main/test/test_browser.py", line 5253, in test_wasm_worker_lock_async_acquire
    self.btest_exit('wasm_worker/lock_async_acquire.c', cflags=['--closure=1', '-sWASM_WORKERS'])
    ~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/clb/buildbot/h12dsi-linux-mint22/emscripten_linux_x64/build/emscripten/main/test/common.py", line 2835, in btest_exit
    return self.btest(filename, *args, **kwargs)
           ~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/clb/buildbot/h12dsi-linux-mint22/emscripten_linux_x64/build/emscripten/main/test/common.py", line 2864, in btest
    self.run_browser(outfile, expected=['/report_result?' + e for e in expected], timeout=timeout)
    ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/clb/buildbot/h12dsi-linux-mint22/emscripten_linux_x64/build/emscripten/main/test/common.py", line 2787, in run_browser
    raise e
  File "/home/clb/buildbot/h12dsi-linux-mint22/emscripten_linux_x64/build/emscripten/main/test/common.py", line 2778, in run_browser
    self.assertContained(expected, output)
    ~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^
  File "/home/clb/buildbot/h12dsi-linux-mint22/emscripten_linux_x64/build/emscripten/main/test/common.py", line 1835, in assertContained
    self.fail("Expected to find '%s' in '%s', diff:\n\n%s\n%s" % (
    ~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      limit_size(values[0]), limit_size(string), limit_size(diff),
      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      additional_info,
      ^^^^^^^^^^^^^^^^
    ))
    ^^
  File "/home/clb/.pyenv/versions/3.13.3/lib/python3.13/unittest/case.py", line 732, in fail
    raise self.failureException(msg)
AssertionError: Expected to find '/report_result?exit:0
' in '/report_result?exception:X[a] is undefined / hb@http://localhost:8916/test.js:543:3
@http://localhost:8916/test.wasm:wasm-function[22]:0x715
@http://localhost:8916/test.wasm:wasm-function[23]:0x816
bb/e/<@http://localhost:8916/test.js:502:12
', diff:

--- expected
+++ actual
@@ -1 +1,5 @@
-/report_result?exit:0
+/report_result?exception:X[a] is undefined / hb@http://localhost:8916/test.js:543:3
+@http://localhost:8916/test.wasm:wasm-function[22]:0x715
+@http://localhost:8916/test.wasm:wasm-function[23]:0x816
+bb/e/<@http://localhost:8916/test.js:502:12
+



----------------------------------------------------------------------

In the above, X[a] is the $_wasmWorkers dictionary in src/libwasm_workers.js.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions