You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@impala.apache.org by Jim Apple <jb...@cloudera.com> on 2017/09/07 22:12:03 UTC

New Impala contributors: IMPALA-5886

If you'd like to contribute a patch to Impala, but aren't sure what
you want to work on, you can look at Impala's newbie issues:
https://issues.apache.org/jira/issues/?filter=12341668. You can find
detailed instructions on submitting patches at
https://cwiki.apache.org/confluence/display/IMPALA/Contributing+to+Impala.
This is a walkthrough of a ticket a new contributor could take on,
with hopefully enough detail to get you going but not so much to take
away the fun.

How can we fix https://issues.apache.org/jira/browse/IMPALA-5886,
"run-tests.py returns error overeagerly"?

First, set yourself up with a development environment. Then, reproduce
the test case shown in the ticket:

FE_TEST=false BE_TEST=false EE_TEST=true
EE_TEST_FILES=query_test/test_udfs.py JDBC_TEST=false
CLUSTER_TEST=false bin/run-all-tests.sh

This takes a couple of minutes to run for me. If you look through the
output, you can see that no stress tests are executed. A notice of
that is printed (in my terminal) in a yellow font, unlike the passing
test results, which are printed in green. The problem, of course, is
not the color, but the fact that the exit value from the program is 1,
which indicates a non-successful run. You can verify this in bash by
"echo $?" after running the test.

The ticket itself points out where the bug itself is in run-tests.py:
in the run_tests method on the class TestExecutor. The variable
exit_code is set to the return value of the call to pytest.main, and
that is compared against 0 in order to set self.tests_failed. However,
https://docs.pytest.org/en/latest/usage.html points out that a return
value of 5 simply means "no tests were run", which is arguably not an
error.

One way to fix this is to compare 0 < exit_code < 5. This will return
true when no tests are actually run, even if the user intended for
some to be run, so another way to fix that would be to add a flag to
the program (following how the --help flag is specified) to enforce
that at least one test ran. If that flag is passed, the sys.exit(1)
call would be made in either the case that a test failed or that no
tests ran. Otherwise, running zero tests is likely not an error and
the program can exit normally.