File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -136,18 +136,19 @@ exports.all = function (test, testCommon) {
136136 if ( ! deferred ) await sub1 . open ( )
137137 if ( ! deferred ) await sub2 . open ( )
138138
139- const batch1 = sub1 . batch ( )
140- const batch2 = sub2 . batch ( )
139+ const batch1 = [ ]
140+ const batch2 = [ ]
141141 const keys = [ ]
142142
143+ // TODO: write before creating the sublevels, to make the deferred test more meaningful
143144 for ( let i = 0 ; i < 256 ; i ++ ) {
144145 const key = keyEncoding === 'buffer' ? Buffer . from ( [ i ] ) : new Uint8Array ( [ i ] )
145146 keys . push ( key )
146- batch1 . put ( key , 'aa' )
147- batch2 . put ( key , 'bb' )
147+ batch1 . push ( { type : 'put' , key, value : 'aa' } )
148+ batch2 . push ( { type : 'put' , key, value : 'bb' } )
148149 }
149150
150- await Promise . all ( [ batch1 . write ( ) , batch2 . write ( ) ] )
151+ await Promise . all ( [ sub1 . batch ( batch1 ) , sub2 . batch ( batch2 ) ] )
151152
152153 const entries1 = await sub1 . iterator ( ) . all ( )
153154 const entries2 = await sub2 . iterator ( ) . all ( )
You can’t perform that action at this time.
0 commit comments