diff options
author | jjrodrig <jjrodrig@gmail.com> | 2018-07-09 23:10:42 +0200 |
---|---|---|
committer | Jan Lehnardt <jan@apache.org> | 2018-07-13 13:43:43 +0200 |
commit | 71cf9f4b53728bd5df5f5b5cc349187ca9da67bb (patch) | |
tree | f9110b4d5a335ff19e205f922c7c201d280727cf | |
parent | 177c22d0f541fdeb6e0f6457ab6ea9afa7bdea9a (diff) | |
download | couchdb-71cf9f4b53728bd5df5f5b5cc349187ca9da67bb.tar.gz |
Adjust deletion tests in different cluster quorum conditions
5 files changed, 20 insertions, 76 deletions
diff --git a/test/javascript/tests-cluster/with-quorum/db-deletion.js b/test/javascript/tests-cluster/with-quorum/db-deletion.js deleted file mode 100644 index 079fb493d..000000000 --- a/test/javascript/tests-cluster/with-quorum/db-deletion.js +++ /dev/null @@ -1,30 +0,0 @@ -// Licensed under the Apache License, Version 2.0 (the "License"); you may not -// use this file except in compliance with the License. You may obtain a copy of -// the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -// License for the specific language governing permissions and limitations under -// the License. - -// Do DB deletion under cluster with quorum conditions. -couchTests.db_deletion = function(debug) { - - if (debug) debugger; - - var db_name = get_random_db_name() - var db = new CouchDB(db_name, {"X-Couch-Full-Commit":"false"}); - - db.createDb(); - - // DB Deletion should return 202 - Acceted as the custer is not complete - xhr = CouchDB.request("DELETE", "/" + db_name + "/"); - T(xhr.status == 202); - -// DB Deletion should return 404 - Not found - xhr = CouchDB.request("DELETE", "/not-existing-db/"); - T(xhr.status == 404); -}; diff --git a/test/javascript/tests-cluster/with-quorum/db_deletion.js b/test/javascript/tests-cluster/with-quorum/db_deletion.js index bef4cae43..079fb493d 100644 --- a/test/javascript/tests-cluster/with-quorum/db_deletion.js +++ b/test/javascript/tests-cluster/with-quorum/db_deletion.js @@ -10,15 +10,21 @@ // License for the specific language governing permissions and limitations under // the License. -// Do DB deletion in a cluster with quorum conditions. +// Do DB deletion under cluster with quorum conditions. couchTests.db_deletion = function(debug) { if (debug) debugger; var db_name = get_random_db_name() var db = new CouchDB(db_name, {"X-Couch-Full-Commit":"false"}); + db.createDb(); - db.deleteDb(); - T(db.last_req.status="200","Should return 200"); + // DB Deletion should return 202 - Acceted as the custer is not complete + xhr = CouchDB.request("DELETE", "/" + db_name + "/"); + T(xhr.status == 202); + +// DB Deletion should return 404 - Not found + xhr = CouchDB.request("DELETE", "/not-existing-db/"); + T(xhr.status == 404); }; diff --git a/test/javascript/tests-cluster/without-quorum/db-deletion.js b/test/javascript/tests-cluster/without-quorum/db-deletion.js deleted file mode 100644 index 006345e30..000000000 --- a/test/javascript/tests-cluster/without-quorum/db-deletion.js +++ /dev/null @@ -1,30 +0,0 @@ -// Licensed under the Apache License, Version 2.0 (the "License"); you may not -// use this file except in compliance with the License. You may obtain a copy of -// the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -// License for the specific language governing permissions and limitations under -// the License. - -// Do DB creation under cluster with quorum conditions. -couchTests.db_deletion = function(debug) { - - if (debug) debugger; - - var db_name = get_random_db_name() - var db = new CouchDB(db_name, {"X-Couch-Full-Commit":"false"}); - - db.createDb(); - - // DB Deletion should return 202 - Acepted - xhr = CouchDB.request("DELETE", "/" + db_name + "/"); - T(xhr.status == 202); - - // DB Deletion should return 404 - Not found - xhr = CouchDB.request("DELETE", "/not-existing-db/"); - T(xhr.status == 404); -}; diff --git a/test/javascript/tests-cluster/without-quorum/db_deletion.js b/test/javascript/tests-cluster/without-quorum/db_deletion.js index 04b15c058..006345e30 100644 --- a/test/javascript/tests-cluster/without-quorum/db_deletion.js +++ b/test/javascript/tests-cluster/without-quorum/db_deletion.js @@ -10,19 +10,21 @@ // License for the specific language governing permissions and limitations under // the License. -// Do DB deletion in a cluster with quorum conditions. +// Do DB creation under cluster with quorum conditions. couchTests.db_deletion = function(debug) { if (debug) debugger; var db_name = get_random_db_name() var db = new CouchDB(db_name, {"X-Couch-Full-Commit":"false"}); - db.createDb(); - //db.deleteDb(); - // TODO DB deletions fails if the quorum is not met. + db.createDb(); + + // DB Deletion should return 202 - Acepted xhr = CouchDB.request("DELETE", "/" + db_name + "/"); - //T(db.last_req.status="202","Should return 202"); - console.log("Skipped-TODO: Fix issue 500 Error on delete. 202->"+xhr.status) - + T(xhr.status == 202); + + // DB Deletion should return 404 - Not found + xhr = CouchDB.request("DELETE", "/not-existing-db/"); + T(xhr.status == 404); }; diff --git a/test/javascript/tests-cluster/without-quorum/db_deletion_overridden_quorum.js b/test/javascript/tests-cluster/without-quorum/db_deletion_overridden_quorum.js index 4a1efce23..11b344cfb 100644 --- a/test/javascript/tests-cluster/without-quorum/db_deletion_overridden_quorum.js +++ b/test/javascript/tests-cluster/without-quorum/db_deletion_overridden_quorum.js @@ -19,11 +19,7 @@ couchTests.db_deletion_overridden_quorum = function(debug) { var db = new CouchDB(db_name, {"X-Couch-Full-Commit":"false"},{"w":1}); db.createDb(); - - //db.deleteDb(); - // TODO DB deletions fails if the quorum is not met. + // DB deletions does not consider overriden quorum param. xhr = CouchDB.request("DELETE", "/" + db_name + "/"); - //T(db.last_req.status="200","Should return 200"); - console.log("Skipped-TODO: Fix issue 500 Error on delete - Not considering overriden quorum. 200->"+xhr.status); - + T(db.last_req.status="202","Should return 202"); }; |