CartoDB-SQL-API/test/acceptance/export/timeout.js

34 lines
959 B
JavaScript
Raw Normal View History

const TestClient = require('../../support/test-client');
require('../../support/assert');
var assert = require('assert');
var server = require('../../../app/server')();
var querystring = require('querystring');
describe('export timeout', function () {
beforeEach(function () {
this.testClient = new TestClient();
});
it('CSV export with slow query exceeding statement timeout returns proper error message', function (done) {
const override = {
format: 'csv',
response: {
status: 429
}
};
this.testClient.getResult('select pg_sleep(2.1) as sleep, 1 as value', override, function (err, res) {
assert.ifError(err);
assert.deepEqual(res, {
error: [
'You are over platform\'s limits. Please contact us to know more details'
]
});
done();
});
});
});