Skip to content

Commit

Permalink
Add highWaterMarkBytes option to tests where it matters
Browse files Browse the repository at this point in the history
The `classic-level` implementation will have this option, replacing
the `highWaterMark` option of `leveldown` which conflicts with
streams.
  • Loading branch information
vweevers committed Feb 6, 2022
1 parent 2e90b05 commit 6b25a91
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
7 changes: 4 additions & 3 deletions test/iterator-no-snapshot-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,10 @@ exports.noSnapshot = function (test, testCommon) {
t.ifError(err, 'no batch error')

// For this test it is important that we don't read eagerly.
// NOTE: highWaterMark is not an abstract option atm, but
// it is supported by leveldown, rocksdb and others.
const it = db.iterator({ highWaterMark: 0 })
// NOTE: highWaterMarkBytes is not an abstract option, but
// it is supported by classic-level and others. Also set the
// old & equivalent leveldown highWaterMark option for compat.
const it = db.iterator({ highWaterMarkBytes: 0, highWaterMark: 0 })

run(db, function (err) {
t.ifError(err, 'no run error')
Expand Down
7 changes: 4 additions & 3 deletions test/iterator-snapshot-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,10 @@ exports.snapshot = function (test, testCommon) {
t.ifError(err, 'no put error')

// For this test it is important that we don't read eagerly.
// NOTE: highWaterMark is not an abstract option atm, but
// it is supported by leveldown, rocksdb and others.
const it = db.iterator({ highWaterMark: 0 })
// NOTE: highWaterMarkBytes is not an abstract option, but
// it is supported by classic-level and others. Also set the
// old & equivalent leveldown highWaterMark option for compat.
const it = db.iterator({ highWaterMarkBytes: 0, highWaterMark: 0 })

run(t, db, it, function end (err) {
t.ifError(err, 'no run error')
Expand Down

0 comments on commit 6b25a91

Please sign in to comment.