Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test.replication: remove "down-server" #8715

Open
wants to merge 11 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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
14 changes: 7 additions & 7 deletions tests/integration/test.replication.js
Original file line number Diff line number Diff line change
Expand Up @@ -4248,6 +4248,8 @@ adapters.forEach(function (adapters) {
// This test only needs to run for one configuration, and it slows stuff
// down
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But... it's currently run for quite a few configurations. And behaves very differently with different configurations. Perhaps this comment should be updated.

describe('suite2 test.replication.js-down-test', function () {
this.timeout(360000);
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Weirdly this is necessary, despite the 10ms timeouts set below. Maybe a bug?


let dbs = {};

beforeEach(function (done) {
Expand All @@ -4260,15 +4262,13 @@ 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', {
ajax: {timeout: 10}
const source = new PouchDB('http://10.1.1.1:1234/store', {
ajax: {timeout: 10},
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|NetworkError when attempting to fetch resource\.)$)|ECONNREFUSED|EHOSTUNREACH|ETIMEDOUT/);
});
});

Expand Down