[ 
https://issues.apache.org/jira/browse/HADOOP-11045?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14293875#comment-14293875
 ] 

Yongjun Zhang commented on HADOOP-11045:
----------------------------------------

Hi [~ozawa],

Thanks a lot for your feedback! I did do some study before deciding to use 
hexversion. Below is what I found:

* hexversion exists in as early version as Python 1.5.2, whereas version_info 
exists only from 2.0 on. 
* hexversion is described as "The version number encoded as a single integer. 
This is guaranteed to increase with each version, including proper support for 
non-production releases", however, per 
http://stackoverflow.com/questions/1093322/how-do-i-check-what-version-of-python-is-running-my-script,
 version_info may not, see " As long you do not endup comparing 
(3,3,0,'rc1','0') and (3,3,0,'beta','0') –  sorin Jun 5 '13 at 9:51 "

Based on this information, I chose to use hexversion. It's a bit harder to 
read, but not too bad. There is a detailed description of the format here: 
https://docs.python.org/2/library/sys.html#sys.hexversion. Please see that when 
I print out error messages, I do print a more readable version info.

What do you think?

Thanks.

--Yongjun




> Introducing a tool to detect flaky tests of hadoop jenkins test job
> -------------------------------------------------------------------
>
>                 Key: HADOOP-11045
>                 URL: https://issues.apache.org/jira/browse/HADOOP-11045
>             Project: Hadoop Common
>          Issue Type: Improvement
>          Components: build, tools
>    Affects Versions: 2.5.0
>            Reporter: Yongjun Zhang
>            Assignee: Yongjun Zhang
>         Attachments: HADOOP-11045.001.patch, HADOOP-11045.002.patch, 
> HADOOP-11045.003.patch, HADOOP-11045.004.patch, HADOOP-11045.005.patch, 
> HADOOP-11045.006.patch, HADOOP-11045.007.patch
>
>
> File this jira to introduce a tool to detect flaky tests of hadoop jenkins 
> test jobs. Certainly it can be adapted to projects other than hadoop.
> I developed the tool on top of some initial work [~tlipcon] did. We find it 
> quite useful. With Todd's agreement, I'd like to push it to upstream so all 
> of us can share (thanks Todd for the initial work and support). I hope you 
> find the tool useful too.
> The idea is, when one has the need to see if the test failure s/he is seeing 
> in a pre-build jenkins run is flaky or not, s/he could run this tool to get a 
> good idea. Also, if one wants to look at the failure trend of a testcase in a 
> given jenkins job, the tool can be used too. I hope people find it useful.
> This tool is for hadoop contributors rather than hadoop users. Thanks 
> [~tedyu] for the advice to put to dev-support dir.
> Description of the tool:
> {code}
> #
> # Given a jenkins test job, this script examines all runs of the job done
> # within specified period of time (number of days prior to the execution
> # time of this script), and reports all failed tests.
> #
> # The output of this script includes a section for each run that has failed
> # tests, with each failed test name listed.
> #
> # More importantly, at the end, it outputs a summary section to list all 
> failed
> # tests within all examined runs, and indicate how many runs a same test
> # failed, and sorted all failed tests by how many runs each test failed in.
> #
> # This way, when we see failed tests in PreCommit build, we can quickly tell 
> # whether a failed test is a new failure or it failed before, and it may just 
> # be a flaky test.
> #
> # Of course, to be 100% sure about the reason of a failed test, closer look 
> # at the failed test for the specific run is necessary.
> #
> {code}
> How to use the tool:
> {code}
> Usage: determine-flaky-tests-hadoop.py [options]
> Options:
>   -h, --help            show this help message and exit
>   -J JENKINS_URL, --jenkins-url=JENKINS_URL
>                         Jenkins URL
>   -j JOB_NAME, --job-name=JOB_NAME
>                         Job name to look at
>   -n NUM_PREV_DAYS, --num-days=NUM_PREV_DAYS
>                         Number of days to examine
> {code}
> Example command line:
> {code}
> ./determine-flaky-tests-hadoop.py -J https://builds.apache.org -j 
> PreCommit-HDFS-Build -n 2 
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to