From 349c4d72c47ad0895af0b35e84c3739f51e43d96 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ra=C3=BAl=20Mar=C3=ADn?= Date: Thu, 9 Apr 2020 13:47:17 +0200 Subject: [PATCH] Remove py_sleep test I think this was added for historical reasons when upstream plpython was not interrumpible, but that's not the case anymore. Right now, either we adapt it to use plpython2u or plpython3u depending on what's available, or we just remove it since upstream was fixed several years ago. It's simpler to remove it --- test/acceptance/app-test.js | 24 ------------------------ test/index.js | 1 - test/support/sql/py_sleep.sql | 5 ----- 3 files changed, 30 deletions(-) delete mode 100644 test/support/sql/py_sleep.sql diff --git a/test/acceptance/app-test.js b/test/acceptance/app-test.js index c5ec5f53..5990e587 100644 --- a/test/acceptance/app-test.js +++ b/test/acceptance/app-test.js @@ -860,30 +860,6 @@ describe('app.test', function () { }); }); - it('GET with slow python script exceeding statement timeout returns proper error message', function (done) { - assert.response(server, { - url: '/api/v1/sql?q=select%20py_sleep(2.1)', - headers: { host: 'vizzuality.cartodb.com' }, - method: 'GET' - }, - { - // status: 429, ---> Both 200 and 429 are valid - headers: { - 'Content-Type': 'application/json; charset=utf-8' - } - }, - function (err, res) { - assert.ifError(err); - var error = JSON.parse(res.body); - assert.deepStrictEqual(error.error, [ - 'You are over platform\'s limits: SQL query timeout error.' + - ' Refactor your query before running again or contact CARTO support for more details.' - ]); - - done(); - }); - }); - it('too large rows get into error log', function (done) { var dbMaxRowSize = global.settings.db_max_row_size; global.settings.db_max_row_size = 4; diff --git a/test/index.js b/test/index.js index 8025d5e3..b30aa3e8 100644 --- a/test/index.js +++ b/test/index.js @@ -55,7 +55,6 @@ async function populateDatabase () { const filenames = [ 'test', 'populated_places_simple_reduced', - 'py_sleep', 'quota_mock' ].map(filename => `${__dirname}/support/sql/${filename}.sql`); diff --git a/test/support/sql/py_sleep.sql b/test/support/sql/py_sleep.sql deleted file mode 100644 index 5c48ba17..00000000 --- a/test/support/sql/py_sleep.sql +++ /dev/null @@ -1,5 +0,0 @@ -CREATE OR REPLACE FUNCTION py_sleep(t FLOAT8) -RETURNS void AS $$ - import time - time.sleep(t) -$$ LANGUAGE plpythonu;