File tree Expand file tree Collapse file tree 2 files changed +14
-14
lines changed Expand file tree Collapse file tree 2 files changed +14
-14
lines changed Original file line number Diff line number Diff line change 11const chai = require ( 'chai' ) ;
2- chai . use ( require ( 'chai-as-promised' ) )
2+ chai . use ( require ( 'chai-as-promised' ) ) ;
33const expect = chai . expect ;
44
55module . exports = {
@@ -9,29 +9,29 @@ module.exports = {
99 console . log ( 'stat intensive 1' ) ;
1010
1111 const dir_count = 10 ;
12- const subdir_count = 100 ;
12+ const subdir_count = 10 ;
1313
1414 // key: uuid
1515 // value: path
1616 const dirs = { } ;
1717
18- for ( let i = 0 ; i < dir_count ; i ++ ) {
18+ for ( let i = 0 ; i < dir_count ; i ++ ) {
1919 await t . mkdir ( `dir_${ i } ` ) ;
20- for ( let j = 0 ; j < subdir_count ; j ++ ) {
20+ for ( let j = 0 ; j < subdir_count ; j ++ ) {
2121 const subdir = await t . mkdir ( `dir_${ i } /subdir_${ j } ` ) ;
2222 dirs [ subdir . uid ] = subdir . path ;
2323 }
2424 }
2525
2626 const start = Date . now ( ) ;
27- for ( let i = 0 ; i < 10 ; i ++ ) {
28- for ( const [ uuid , path ] of Object . entries ( dirs ) ) {
27+ for ( let i = 0 ; i < 10 ; i ++ ) {
28+ for ( const [ uuid , path ] of Object . entries ( dirs ) ) {
2929 const stat = await t . stat_uuid ( uuid ) ;
3030 expect ( stat . is_dir ) . equal ( true ) ;
3131 expect ( stat . path ) . equal ( path ) ;
3232 }
3333 }
3434 const duration = Date . now ( ) - start ;
3535 return { duration } ;
36- }
36+ } ,
3737} ;
Original file line number Diff line number Diff line change 11const chai = require ( 'chai' ) ;
2- chai . use ( require ( 'chai-as-promised' ) )
2+ chai . use ( require ( 'chai-as-promised' ) ) ;
33const expect = chai . expect ;
44
55module . exports = {
@@ -8,25 +8,25 @@ module.exports = {
88 do : async t => {
99 console . log ( 'write intensive 1' ) ;
1010
11- const dir_count = 100 ;
11+ const dir_count = 10 ;
1212 const file_count = 10 ;
1313
14- for ( let i = 0 ; i < dir_count ; i ++ ) {
14+ for ( let i = 0 ; i < dir_count ; i ++ ) {
1515 await t . mkdir ( `dir_${ i } ` ) ;
16- for ( let j = 0 ; j < file_count ; j ++ ) {
16+ for ( let j = 0 ; j < file_count ; j ++ ) {
1717 const content = `example ${ i } ${ j } ` ;
1818 await t . write ( `dir_${ i } /file_${ j } .txt` , content , { overwrite : true } ) ;
1919 }
2020 }
2121
22- for ( let i = 0 ; i < dir_count ; i ++ ) {
22+ for ( let i = 0 ; i < dir_count ; i ++ ) {
2323 const dir = await t . stat ( `dir_${ i } ` ) ;
2424 const files = await t . readdir ( dir . path ) ;
2525 expect ( files . length ) . equal ( file_count ) ;
26- for ( let j = 0 ; j < file_count ; j ++ ) {
26+ for ( let j = 0 ; j < file_count ; j ++ ) {
2727 const content = await t . read ( `dir_${ i } /file_${ j } .txt` ) ;
2828 expect ( content ) . equal ( `example ${ i } ${ j } ` ) ;
2929 }
3030 }
31- }
31+ } ,
3232} ;
You can’t perform that action at this time.
0 commit comments