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

Fix flaky test in ctl module #653

Closed
wants to merge 1 commit into from
Closed

Fix flaky test in ctl module #653

wants to merge 1 commit into from

Conversation

ulysses-you
Copy link
Contributor

@ulysses-you ulysses-you commented May 31, 2021

Why are the changes needed?

As zookeeper mentioned, the result of getChildren is no guarantee order. So it is also no guarantee order that use exists children to create new node .

flaky test log:

- test expose zk service node to another namespace *** FAILED ***
  "...ceUri=localhost:1000[1];version=1.2.0;seque..." did not equal "...ceUri=localhost:1000[0];version=1.2.0;seque..." (ServiceControlCliSuite.scala:212)
  Analysis:
  "...ceUri=localhost:1000[1];version=1.2.0;seque..." -> "...ceUri=localhost:1000[0];version=1.2.0;seque..."

zookeeper description:

    /**
     * For the given znode path return the stat and children list.
     * <p>
     * If the watch is true and the call is successful (no exception is thrown),
     * a watch will be left on the node with the given path. The watch will be
     * triggered by a successful operation that deletes the node of the given
     * path or creates/delete a child under the node.
     * <p>
     * The list of children returned is not sorted and no guarantee is provided
     * as to its natural or lexical order.
     * <p>
     * A KeeperException with error code KeeperException.NoNode will be thrown
     * if no node with the given path exists.
     *
     * @since 3.3.0
     * 
     * @param path
     * @param watch
     * @param stat stat of the znode designated by path
     * @return an unordered array of children of the node with the given path
     * @throws InterruptedException If the server transaction is interrupted.
     * @throws KeeperException If the server signals an error with a non-zero
     *  error code.
     */
    public List<String> getChildren(String path, boolean watch, Stat stat)
            throws KeeperException, InterruptedException {
        return getChildren(path, watch ? watchManager.defaultWatcher : null,
                stat);
    }

How was this patch tested?

Pass CI.

@ulysses-you ulysses-you added this to the v1.2.0 milestone May 31, 2021
@ulysses-you ulysses-you self-assigned this May 31, 2021
@yaooqinn
Copy link
Member

cc @turboFei

@ulysses-you ulysses-you changed the title Fix flaky test in ctl moudle Fix flaky test in ctl module May 31, 2021
@codecov-commenter
Copy link

codecov-commenter commented May 31, 2021

Codecov Report

Merging #653 (0be8248) into master (b09c87b) will increase coverage by 0.02%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #653      +/-   ##
==========================================
+ Coverage   80.05%   80.07%   +0.02%     
==========================================
  Files         120      120              
  Lines        4693     4693              
  Branches      568      568              
==========================================
+ Hits         3757     3758       +1     
  Misses        611      611              
+ Partials      325      324       -1     
Impacted Files Coverage Δ
.../scala/org/apache/kyuubi/server/KyuubiServer.scala 47.36% <0.00%> (-2.64%) ⬇️
...org/apache/spark/kyuubi/SQLOperationListener.scala 97.43% <0.00%> (+5.12%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b09c87b...0be8248. Read the comment docs.

Copy link
Member

@turboFei turboFei left a comment

Choose a reason for hiding this comment

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

thanks

@turboFei turboFei closed this in 55df645 Jun 1, 2021
@turboFei
Copy link
Member

turboFei commented Jun 1, 2021

thanks, merged to master

@ulysses-you ulysses-you deleted the flaky-test-ctl branch June 1, 2021 01:28
ulysses-you added a commit that referenced this pull request Jun 1, 2021
<!--
Thanks for sending a pull request!

Here are some tips for you:
  1. If this is your first time, please read our contributor guidelines: https://kyuubi.readthedocs.io/en/latest/community/contributions.html
  2. If the PR is related to an issue in https://github.com/NetEase/kyuubi/issues, add '[KYUUBI #XXXX]' in your PR title, e.g., '[KYUUBI #XXXX] Your PR title ...'.
  3. If the PR is unfinished, add '[WIP]' in your PR title, e.g., '[WIP][KYUUBI #XXXX] Your PR title ...'.
-->

### _Why are the changes needed?_
<!--
Please clarify why the changes are needed. For instance,
  1. If you add a feature, you can talk about the use case of it.
  2. If you fix a bug, you can clarify why it is a bug.
-->

As `zookeeper` mentioned, the result of getChildren is no guarantee order.  So it is also no guarantee order that use exists children to create new node .

flaky test log:
```
- test expose zk service node to another namespace *** FAILED ***
  "...ceUri=localhost:1000[1];version=1.2.0;seque..." did not equal "...ceUri=localhost:1000[0];version=1.2.0;seque..." (ServiceControlCliSuite.scala:212)
  Analysis:
  "...ceUri=localhost:1000[1];version=1.2.0;seque..." -> "...ceUri=localhost:1000[0];version=1.2.0;seque..."
```

zookeeper description:
```
    /**
     * For the given znode path return the stat and children list.
     * <p>
     * If the watch is true and the call is successful (no exception is thrown),
     * a watch will be left on the node with the given path. The watch will be
     * triggered by a successful operation that deletes the node of the given
     * path or creates/delete a child under the node.
     * <p>
     * The list of children returned is not sorted and no guarantee is provided
     * as to its natural or lexical order.
     * <p>
     * A KeeperException with error code KeeperException.NoNode will be thrown
     * if no node with the given path exists.
     *
     * since 3.3.0
     *
     * param path
     * param watch
     * param stat stat of the znode designated by path
     * return an unordered array of children of the node with the given path
     * throws InterruptedException If the server transaction is interrupted.
     * throws KeeperException If the server signals an error with a non-zero
     *  error code.
     */
    public List<String> getChildren(String path, boolean watch, Stat stat)
            throws KeeperException, InterruptedException {
        return getChildren(path, watch ? watchManager.defaultWatcher : null,
                stat);
    }

```

### _How was this patch tested?_
Pass CI.

Closes #653 from ulysses-you/flaky-test-ctl.

Closes #653

0be8248 [ulysses-you] fix

Authored-by: ulysses-you <ulyssesyou18@gmail.com>
Signed-off-by: fwang12 <fwang12@ebay.com>
(cherry picked from commit 55df645)
Signed-off-by: ulysses-you <ulyssesyou18@gmail.com>
@ulysses-you
Copy link
Contributor Author

thanks , also merged to branch-1.2

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.

4 participants