Skip to content

Commit

Permalink
test.replication: remove "down-server"
Browse files Browse the repository at this point in the history
The naming of the replication test which accessed the "down server" implies it's
attempting to connect to a server which is down.  The test actually passed for
any non-pouchdb server, including:

* a hostname which doesn't resolve
* a hostname which resolves but server does not respond
* a server which responds, but not as a couch server
  • Loading branch information
alxndrsn committed Jul 26, 2023
1 parent f1a9b89 commit c938fc1
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 24 deletions.
12 changes: 0 additions & 12 deletions bin/down-server.js

This file was deleted.

6 changes: 0 additions & 6 deletions bin/test-node.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,6 @@ else
fi

if [ $TYPE = "integration" ]; then
if (: < /dev/tcp/127.0.0.1/3010) 2>/dev/null; then
echo "down-server port already in use"
else
node bin/down-server.js 3010 & export DOWN_SERVER_PID=$!
fi

TESTS_PATH="tests/integration/test.*.js"
fi
if [ $TYPE = "fuzzy" ]; then
Expand Down
8 changes: 2 additions & 6 deletions tests/integration/test.replication.js
Original file line number Diff line number Diff line change
Expand Up @@ -4260,15 +4260,11 @@ describe('suite2 test.replication.js-down-test', function () {
});

it('replicate from down server test', async () => {
const source = new PouchDB('http://127.0.0.1:3010', {
const source = new PouchDB('http://10.1.1.1:1234/store', {
ajax: {timeout: 10}
});
const target = new PouchDB(dbs.name);
try {
await source.replicate.to(target);
} catch (error) {
should.exist(error);
}
await source.replicate.to(target).should.be.rejectedWith(/^Failed to fetch$/);
});
});

Expand Down

0 comments on commit c938fc1

Please sign in to comment.