• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

pouchdb / pouchdb / 8651
100%

Build:
DEFAULT BRANCH: master
Ran 31 Oct 2016 01:28PM UTC
Jobs 1
Files 1
Run time 7521min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

pending completion
8651

push

travis-ci

daleharvey
(#5812) - Fix memleak in pouchdb-core

* fix(memleak): correct `destroyed` event handler memory leak on `close()`

Fixes https://github.com/pouchdb/pouchdb/issues/4868

* Initial code for the memleak test

* corrected heap snapshot file names

* chore(run): instrument memleak test

* fix(memleak-test): make sure to emit `closed`

In order to use the fix for #4868

* feat(memleak-test): add test with live PouchDB core

* chore(test): document the differences between the three test suites

Note that the "adapters" test suite currently fails because the adapters leak.

* chore(memleak-test): disable leveldown test for now

I'm not going to focus on it.

* chore(memleak-test): revert to sending JSON content-type

* fix(memleak-test): correct http test

The server was timing out, this runs fine.

* refactor(memleak-test): move memleak test in a separate directory

* fix(memleak): correct removal of the constructor listener, add removal of `closed` listener.

* fix(memleak): remove leaking of names.

When using the Map in setup.js, if we only `close()` objects, the cleanup code was never called on it, leading to a leak of the names (strings used as index in the Map).

* chore(memleak-test): adopt stricter limits for reference code

* chore(memleak-test): print results out in all cases

This helps (currently) with designing proper limits.

* feat(memleak-test): test for many names

This tests for how well we clear up names on `close()`.

* refactor(memleak-test): run a new server per request

This allows to span different names (because of differing ports) and helps reduce Express leaked items in the heapdumps.

* chore(memleak-test): cleanup server instance

I don't think this is a good way to test, honestly, since it appears Express is also leaking.
I'll be reverting to using a real (external) CouchDB, and disable the test for now so that I can push it in a PR.

* chore(memleak-test): disable http adater test

* chore(build): clean npm `run` task for memleak test

* fix(memleak-test): do not attempt to dump heap

* fix(memleak): do not leak arguments

These two functions are potentially used by the http adapter, and greatly improve memleak issues with it.
Based on comments in https://github.com/petkaantonov/bluebird/wiki/Optimization-killers#32-leaking-arguments

Next commit corrects other (non-adapter-related) handling of arguments as well.

* fix(memleak): do no leak `arguments`

Same as previous commit, see https://github.com/petkaantonov/bluebird/wiki/Optimization-killers#32-leaking-arguments for more details.

* chore(memleak-test): replace internal Express server with external CouchDB

Apparently the test suite in Travis relies on the COUCH_HOST environment variable, re-using it.

* chore(lint): make linter happy

* chore(memleak-test): continue on single failed item

Seeing sporadic ETIMEDOUT errors while testing against external CouchDB.

* chore(memleak-test): add support for DUMP_HEAP=true debug environment variable

This way heap dumps can be trigerred from the command line.

* refactor(memleak-test): simplify layout of runner.

- Introduced a `Runner` function.
- Make a few runs before initializing heap measurements so that V8 has some time to optimize/deoptimize.
- Add `Finally` functions so that `close()` is also called in case of failures.

* chore(memleak-test): document, log report in all cases, add proper default.

* chore(linter): make linter happy

* fix(memleak): remove the destruction listener on close()

Calling `close()` is a final method, the same way that calling `destroy()` is a final method.
Even if another instance closes the same database, there is no reason we should notify our instance's user of it (since it notified its intent to be done with our instance by expressely calling `close()`).

* chore(memleak-test): add leveldown test

* Partially revert d76b009f2

* Revert "fix(memleak): do no leak `arguments`"

This reverts commit bf1f7c93d.

* Revert "fix(memleak): do not leak arguments"

This reverts commit 26374de94.

* chore(eslint): correct syntax

* chore(spaces): insert spaces as wanted

4629 of 4629 relevant lines covered (100.0%)

26783.14 hits per line

Jobs
ID Job ID Ran Files Coverage
37 8651.37 (COMMAND=report-coverage COVERAGE=1) 05 Nov 2016 06:50PM UTC 0
100.0
Travis Job 8651.37
Source Files on build 8651
Detailed source file information is not available for this build.
  • Back to Repo
  • Travis Build #8651
  • 4a6a2391 on github
  • Prev Build on master (#8638)
  • Next Build on master (#8652)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc