Hello Kudu Jenkins,

I'd like you to reexamine a change.  Please visit

    http://gerrit.cloudera.org:8080/7850

to look at the new patch set (#2).

Change subject: KUDU-1976. java: use ephemeral ports for MiniKDC
......................................................................

KUDU-1976. java: use ephemeral ports for MiniKDC

This fixes an issue where Java tests would occasionally fail due to failure to
kinit as a principal just after adding it. We initially interpreted this as
a race, but it turns out to be an issue with concurrent test execution on
the same slave:

- We were using Testutils.findFreePort() to look for an open port. This was
  in turn calling TestUtils.getUniqueLocalHost() when it was testing binding
  to ports. Because it used the "unique localhost", it would always successfully
  bind on the first port it tried, since another concurrently-running test
  would not have used that port.

- Meanwhile, when we actually started the KDC, we bound it to 0.0.0.0:<port>
  rather than the unique loopback. This is because the KDC does not actually
  support specifying a bind-address.

- Even worse, the KDC would successfully start up in this case and only log
  a warning that it had failed to bind to the requested port. So, we'd merrily
  continue on our way with a lame-duck KDC.

The tests would often pass despite this, since we'd create our KDC, add a user
to it, and then connect to the _other_ test's KDC. That KDC would likely also
have the appropriate user "testuser". However there was a small window where
the other KDC would have started already but not yet created the "testuser"
user, in which case the test would fail.

This patch fixes the issue by following the same approach as the C++ tests:
we start the KDC on an ephemeral port and then use lsof to figure out which
port it picked.

Change-Id: I1e75d89616e6dbca6e8687eeb23f807c3c7eb952
---
M java/kudu-client/src/test/java/org/apache/kudu/client/MiniKdc.java
M java/kudu-client/src/test/java/org/apache/kudu/client/TestUtils.java
2 files changed, 86 insertions(+), 52 deletions(-)


  git pull ssh://gerrit.cloudera.org:29418/kudu refs/changes/50/7850/2
-- 
To view, visit http://gerrit.cloudera.org:8080/7850
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I1e75d89616e6dbca6e8687eeb23f807c3c7eb952
Gerrit-PatchSet: 2
Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-Owner: Todd Lipcon <t...@apache.org>
Gerrit-Reviewer: Alexey Serbin <aser...@cloudera.com>
Gerrit-Reviewer: Dan Burkert <danburk...@apache.org>
Gerrit-Reviewer: Kudu Jenkins
Gerrit-Reviewer: Todd Lipcon <t...@apache.org>

Reply via email to