Skip to content
This repository has been archived by the owner on Aug 31, 2018. It is now read-only.

test: add more tests for workers #121

Closed
wants to merge 2 commits into from
Closed

Conversation

addaleax
Copy link
Contributor

[the first commit is temporary, from #120, to make tests pass]

Taken from petkaantonov/io.js@ea143f7
and modified to fit current linter rules and coding style.

Also, some new tests were added to the suite.

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • commit message follows commit guidelines
Affected core subsystem(s)

test/worker

addaleax and others added 2 commits October 23, 2017 00:59
Worker threads need an event loop without active libuv handles in
order to shut down. One source of handles that was previously
not accounted for were delayed V8 tasks; these create timers
that would be standing in the way of clearing the event loop.

To solve this, keep track of the scheduled tasks in a list
and close their timer handles before the corresponding isolate/loop
is removed from the platform.

It is not clear from the V8 documentation what the expectation is
with respect to pending background tasks at the end of the
isolate lifetime; however, an alternative approach of executing
these scheduled tasks when flushing them led to an infinite loop
of tasks scheduling each other; so it seems safe to assume that
the behaviour implemented in this patch is at least acceptable.
Taken from petkaantonov/io.js@ea143f7
and modified to fit current linter rules and coding style.

Also, some new tests were added to the suite.

require('../common');

require('./index.js').runTestsInsideWorker([
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might be better, if possible, to grab all files from a readdir that match the test-${subsystem} prefix for each of these and explicitly blacklist specific files known to not work. That way new tests will run in worker tests too, by default.

@addaleax addaleax closed this Jun 11, 2018
@addaleax addaleax deleted the more-workers-test branch June 11, 2018 18:13
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants