Skip to content

Switch make elixir to use n = 1#2363

Merged
davisp merged 1 commit intomasterfrom
change-elixir-tests-n-1
Dec 16, 2019
Merged

Switch make elixir to use n = 1#2363
davisp merged 1 commit intomasterfrom
change-elixir-tests-n-1

Conversation

@garrensmith
Copy link
Copy Markdown
Member

Overview

Switch make elixir to use n = 1. This matches how the javascript tests are run and hopefully should make the elixir tests a little more consistent and less flaky.

Testing recommendations

Tests should pass on Travis and Jenkins

Related Issues or Pull Requests

Checklist

  • Code is written and works correctly
  • Changes are covered by tests
  • Any new configurable parameters are documented in rel/overlay/etc/default.ini
  • A PR for documentation changes has been made in https://github.com/apache/couchdb-documentation

Comment thread test/elixir/test/reshard_basic_test.exs Outdated
assert resp.status_code == 200
shards = resp.body["shards"]
assert node1 not in shards["00000000-ffffffff"]
# assert node1 not in shards["00000000-ffffffff"]
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

@nickva I've had to comment out this line. Does this still make the test valid?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Let's replace it with

assert node1 not in Map.get(shards, "00000000-ffffffff", [])

This way it will still check that the original range was gone and work on n=1 and n>2 cases

(Added a bit of extra explanation in a similar assert below)

Comment thread test/elixir/test/reshard_basic_test.exs Outdated
shards = resp.body["shards"]
assert node1 not in shards["00000000-7fffffff"]
assert node1 not in shards["80000000-ffffffff"]
# assert node1 not in shards["00000000-7fffffff"]
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

@nickva I've had to comment out these two lines. Is the test still valid?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Still valid. But maybe better to replace the checks with

    assert node1 not in Map.get(shards, "00000000-7fffffff", [])
    assert node1 not in Map.get(shards, "80000000-ffffffff", [])

What that means is before we were checking that after those ranges were split, the copies from the original node and range were gone. With other nodes in that range on node2 and node3, shards[00..-7f..] was returning a list of [node2, node3]. Then with n=1,there are no copies in the those ranges on any nodes so shards[...] was failing. The fix is to do a get with a default value of [], so it would work on both n=1 and n>1

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Awesome thanks @nickva. I've changed the tests.

@garrensmith
Copy link
Copy Markdown
Member Author

Tests passed first time on Travis 🎉

Copy link
Copy Markdown
Member

@rnewson rnewson left a comment

Choose a reason for hiding this comment

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

good idea.

@wohali
Copy link
Copy Markdown
Member

wohali commented Dec 15, 2019

@garrensmith temporary, or permanent change?

@garrensmith
Copy link
Copy Markdown
Member Author

garrensmith commented Dec 15, 2019 via email

Copy link
Copy Markdown
Contributor

@iilyak iilyak left a comment

Choose a reason for hiding this comment

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

+1.

@janl
Copy link
Copy Markdown
Member

janl commented Dec 16, 2019

+1

until we rewrite the tests to be specifically n>1 compatible, we should keep it as one.

going to n=3 without rewriting the tests was aspirational at best

@garrensmith
Copy link
Copy Markdown
Member Author

If the next release after 3.0 is with FDB, I don't think there would be much to gain by rewriting the tests to be n = 3.

@wohali
Copy link
Copy Markdown
Member

wohali commented Dec 16, 2019

there will absolutely be a 3.x chain for a while in parallel with 4.0; whether 3.1 predates or postdates 4.0 is anyone's guess at this point.

Copy link
Copy Markdown
Contributor

@jaydoane jaydoane left a comment

Choose a reason for hiding this comment

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

LGTM:

$ make elixir
...
Finished in 37.5 seconds
293 tests, 0 failures, 26 excluded

@davisp davisp force-pushed the change-elixir-tests-n-1 branch from f39bced to 9d2d7be Compare December 16, 2019 19:13
@davisp davisp merged commit 831f78e into master Dec 16, 2019
@davisp davisp deleted the change-elixir-tests-n-1 branch December 16, 2019 20:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants