Skip to content

Commit

Permalink
ci: add sleep after saving mongo
Browse files Browse the repository at this point in the history
  • Loading branch information
yunnysunny committed Sep 1, 2022
1 parent adc40ed commit 1a41a89
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 1 deletion.
5 changes: 5 additions & 0 deletions test/mocha/format_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,11 @@ describe('format test:',function() {
done();
});
});
it('sleep 500ms', function(done) {
setTimeout(() => {
done();
}, 500);
});
it('the ' + TO_FORMAT_FIELD + ' will be format to ' + MY_PARAM + FORMAT_SUFFIX,function(done) {
requestLogModel.findOne({},{custom_headers: 1,req_data:1},{
sort:{_id:-1},lean:true
Expand Down
21 changes: 20 additions & 1 deletion test/mocha/mongodb_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,11 @@ describe('mongodb test:',function() {
done();
});
});
it('sleep 500ms', function(done) {
setTimeout(() => {
done();
}, 500);
});
it('the lastest url is ' + reqUrl,function(done) {
requestLogModel.findOne({},{original_url:1, custom_headers: 1},{
sort:{_id:-1},lean:true
Expand All @@ -48,6 +53,11 @@ describe('mongodb test:',function() {
done();
});
});
it('sleep 500ms', function(done) {
setTimeout(() => {
done();
}, 500);
});
it('the lastest url is /do-get-res-code and res_code is 1000',function(done) {
requestLogModel.findOne({},{original_url:1,res_code:1},{
sort:{_id:-1},lean:true
Expand Down Expand Up @@ -92,7 +102,11 @@ describe('mongodb test:',function() {
}
}, 1000);
});

it('sleep 500ms', function(done) {
setTimeout(() => {
done();
}, 500);
});
it('get abort requst', function(done) {
requestLogModel.findOne({},{req_data:1, aborted: 1},{
sort:{_id:-1},lean:true
Expand Down Expand Up @@ -122,6 +136,11 @@ describe('mongodb test:',function() {
});

});
it('sleep 500ms', function(done) {
setTimeout(() => {
done();
}, 500);
});
it('get res_data success',function(done) {
requestLogModel.findOne({},{original_url:1,res_code:1, res_data:1},{
sort:{_id:-1},lean:true
Expand Down

0 comments on commit 1a41a89

Please sign in to comment.