Skip to content

Commit

Permalink
Temporarily repeat tests
Browse files Browse the repository at this point in the history
  • Loading branch information
vweevers committed Apr 26, 2019
1 parent 2b72134 commit 5b2e2a6
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"main": "leveldown.js",
"scripts": {
"install": "node-gyp-build",
"test": "standard && nyc tape test/*-test.js",
"test": "standard && npm run test-gc && nyc tape test/*-test.js",
"test-gc": "npx -n=--expose-gc tape test/{cleanup,iterator-gc,chained-batch-gc}*-test.js",
"test-electron": "electron test/electron.js",
"coverage": "nyc report --reporter=text-lcov | coveralls",
Expand Down
10 changes: 8 additions & 2 deletions test/chained-batch-gc-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,15 @@
const test = require('tape')
const testCommon = require('./common')

function repeat (name, fn) {
for (let i = 0; i < 100; i++) {
test(`${name} (${i})`, fn)
}
}

// When we have a chained batch object without a reference, V8 might GC it
// before we get a chance to (asynchronously) write the batch.
test('chained batch without ref does not get GCed before write', function (t) {
repeat('chained batch without ref does not get GCed before write', function (t) {
t.plan(2)

const db = testCommon.factory()
Expand All @@ -15,7 +21,7 @@ test('chained batch without ref does not get GCed before write', function (t) {

let batch = db.batch()

for (let i = 0; i < 1e3; i++) {
for (let i = 0; i < 1e5; i++) {
batch.put(String(i), 'value')
}

Expand Down

0 comments on commit 5b2e2a6

Please sign in to comment.