mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -05:00
Merge pull request #2132 from overleaf/spd-collabratec-tests
Make collabratec tests not depend on previous run state GitOrigin-RevId: 264f946e05b848fa253b6fbdd8e97a4998e4158e
This commit is contained in:
parent
4defd2b6b5
commit
a319073a08
3 changed files with 28 additions and 5 deletions
|
@ -20,6 +20,9 @@ const RollingRateLimiter = require('rolling-rate-limiter')
|
||||||
|
|
||||||
module.exports = RateLimiter = {
|
module.exports = RateLimiter = {
|
||||||
addCount(opts, callback) {
|
addCount(opts, callback) {
|
||||||
|
if (settings.disableRateLimits) {
|
||||||
|
return callback(null, true)
|
||||||
|
}
|
||||||
if (callback == null) {
|
if (callback == null) {
|
||||||
callback = function(err, shouldProcess) {}
|
callback = function(err, shouldProcess) {}
|
||||||
}
|
}
|
||||||
|
|
|
@ -411,10 +411,14 @@ class User {
|
||||||
}
|
}
|
||||||
if ((body != null ? body.project_id : undefined) == null) {
|
if ((body != null ? body.project_id : undefined) == null) {
|
||||||
error = new Error(
|
error = new Error(
|
||||||
|
JSON.stringify([
|
||||||
'SOMETHING WENT WRONG CREATING PROJECT',
|
'SOMETHING WENT WRONG CREATING PROJECT',
|
||||||
|
name,
|
||||||
|
options,
|
||||||
response.statusCode,
|
response.statusCode,
|
||||||
response.headers['location'],
|
response.headers['location'],
|
||||||
body
|
body
|
||||||
|
])
|
||||||
)
|
)
|
||||||
return callback(error)
|
return callback(error)
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -1,7 +1,23 @@
|
||||||
// TODO: This file was created by bulk-decaffeinate.
|
// TODO: This file was created by bulk-decaffeinate.
|
||||||
// Sanity-check the conversion and remove this comment.
|
// Sanity-check the conversion and remove this comment.
|
||||||
const BASE_URL = `http://${process.env['HTTP_TEST_HOST'] || 'localhost'}:3000`
|
const BASE_URL = `http://${process.env['HTTP_TEST_HOST'] || 'localhost'}:3000`
|
||||||
module.exports = require('request').defaults({
|
const request = require('request').defaults({
|
||||||
baseUrl: BASE_URL,
|
baseUrl: BASE_URL,
|
||||||
followRedirect: false
|
followRedirect: false
|
||||||
})
|
})
|
||||||
|
|
||||||
|
module.exports = request
|
||||||
|
|
||||||
|
module.exports.promises = {
|
||||||
|
request: function(options) {
|
||||||
|
return new Promise((resolve, reject) => {
|
||||||
|
request(options, (err, response) => {
|
||||||
|
if (err) {
|
||||||
|
reject(err)
|
||||||
|
} else {
|
||||||
|
resolve(response)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in a new issue