Skip to content

test_poll_blocking is occasionally flaky in CI #26256

@sbc100

Description

@sbc100
FAIL: test_poll_blocking (test_core.core2.test_poll_blocking)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Volumes/Work/s/w/ir/x/w/install/emscripten/test/decorators.py", line 216, in decorated
    return func(self, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Volumes/Work/s/w/ir/x/w/install/emscripten/test/test_core.py", line 9594, in test_poll_blocking
    self.do_runf('core/test_poll_blocking.c', cflags=['-pthread', '-sPROXY_TO_PTHREAD=1', '-sEXIT_RUNTIME=1'])
  File "/Volumes/Work/s/w/ir/x/w/install/emscripten/test/common.py", line 1395, in do_runf
    return self._build_and_run(filename, expected_output, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Volumes/Work/s/w/ir/x/w/install/emscripten/test/common.py", line 1443, in _build_and_run
    js_output = self.run_js(js_file, engine, args,
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Volumes/Work/s/w/ir/x/w/install/emscripten/test/common.py", line 1026, in run_js
    self.fail('JS subprocess failed (%s): %s (expected=%s).  Output:\n%s' % (error.cmd, error.returncode, assert_returncode, ret))
AssertionError: JS subprocess failed (/Volumes/Work/s/w/ir/cache/builder/emscripten-releases/node-v22.16.0-darwin-x64/bin/node --stack-trace-limit=50 --trace-uncaught /Volumes/Work/s/w/ir/x/t/emtest_bym9_xvr/emscripten_test_core2_ahsdup47/test_poll_blocking.js): 1 (expected=0).  Output:
test_poll_in_threads
 -> duration: 2078 ms
 -> duration: 2066 ms
test_timeout_without_fds
 -> duration: 1001 ms
test_timeout_with_fds_without_events
 -> duration: 999 ms

So it seems like we are measuring the timeout as 999 instead of 1000.

I'm not sure how that can happen since we are passing 1000 to the poll() call which then issuing setTimeout(.., 1000) under the hood which should never return before 1000ms has passed.
See

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