File tree 2 files changed +5
-1
lines changed
2 files changed +5
-1
lines changed Original file line number Diff line number Diff line change 67
67
"modular" : " PORT=8001 node --watch --trace-warnings ./bin/www -c ./bin/dev-conf.json" ,
68
68
"test" : " mocha -u bdd-lazy-var/getter spec/runner.js" ,
69
69
"test-watch" : " mocha --watch -u bdd-lazy-var/getter spec/runner.js" ,
70
+ "test-s3-play-min-io" : " mocha spec/store_handlers/S3_store_handler.spec.js" ,
70
71
"lint" : " eslint --max-warnings=0 \" lib/**/*.js\" \" bin/**/*.js\" \" spec/**/*.js\" " ,
71
72
"lint:fix" : " eslint --fix \" lib/**/*.js\" \" bin/**/*.js\" \" spec/**/*.js\" "
72
73
},
Original file line number Diff line number Diff line change @@ -95,6 +95,7 @@ module.exports.shouldStoreStreams = function () {
95
95
const blobs = await this . handler . listAdminBlobs ( LIST_DIR_NAME ) ;
96
96
expect ( blobs ) . to . have . length ( 0 ) ;
97
97
98
+ const startTime = new Date ( ) ;
98
99
const content = 'indifferent content' ;
99
100
this . listBlobPath = path . join ( LIST_DIR_NAME , 'some-file.yaml' ) ;
100
101
await this . handler . upsertAdminBlob ( this . listBlobPath , 'text/plain' , content ) ;
@@ -105,7 +106,9 @@ module.exports.shouldStoreStreams = function () {
105
106
// contentType is optional
106
107
expect ( blobs2 [ 0 ] . contentLength ) . to . equal ( content . length ) ;
107
108
expect ( typeof blobs2 [ 0 ] . ETag ) . to . equal ( 'string' ) ;
108
- expect ( new Date ( blobs2 [ 0 ] . lastModified ) ) . to . be . lessThanOrEqual ( new Date ( ) ) ;
109
+ // allows one second of clock skew between S3 server and this server
110
+ expect ( new Date ( blobs2 [ 0 ] . lastModified ) ) . to . be . lessThanOrEqual ( new Date ( Date . now ( ) + 1000 ) ) ;
111
+ expect ( new Date ( blobs2 [ 0 ] . lastModified ) ) . to . be . greaterThanOrEqual ( new Date ( startTime - 1000 ) ) ;
109
112
110
113
await this . handler . deleteAdminBlob ( this . listBlobPath ) ;
111
114
You can’t perform that action at this time.
0 commit comments