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

[BEAM-1715] Fix Python WordCount on Dataflow Mismatch #2244

Conversation

markflyhigh
Copy link
Contributor

@markflyhigh markflyhigh commented Mar 14, 2017

Be sure to do all of the following to help us incorporate your contribution
quickly and easily:

  • Make sure the PR title is formatted like:
    [BEAM-<Jira issue #>] Description of pull request
  • Make sure tests pass via mvn clean verify. (Even better, enable
    Travis-CI on your fork and ensure the whole test matrix passes).
  • Replace <Jira issue #> in the title with the actual Jira issue
    number, if there is one.
  • If this contribution is large, please file an Apache
    Individual Contributor License Agreement.

  • Add more logs for debugging
  • Add sleep before verification in order to give more time to have files ready on FS, especially GCS.

@markflyhigh
Copy link
Contributor Author

+R: @aaltay

@patch.object(ChannelFactory, 'glob')
def test_file_checksum_matcher_read_failed(self, mock_glob):
def test_file_checksum_matcher_read_failed(self, mock_glob, _):
Copy link
Member

Choose a reason for hiding this comment

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

Are you sure this is the right order and not mock_time, mock_glob?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes, otherwise mock_glob will be wrong and following asserts must failed.

for path in matched_path:
with ChannelFactory.open(path, 'r') as f:
for line in f:
read_lines.append(line)
return read_lines

def _matches(self, _):
# Wait to have output file ready on FS
wait_time = 20
Copy link
Member

Choose a reason for hiding this comment

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

Can yo make this configurable, I would assume that not every FS will need such a wait.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

make sense. I can move it to object constructor.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Since this is problem coming from GCS, I think it may better to be configured by test writer in IT when they use GCS as output storage. I'd rather leave default sleep to 0.

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.003%) to 70.177% when pulling 0a76a23 on markflyhigh:python-file-verifier-inconsistency into cc12fd3 on apache:master.

@asfbot
Copy link

asfbot commented Mar 14, 2017

Refer to this link for build results (access rights to CI server needed):
https://builds.apache.org/job/beam_PreCommit_Java_MavenInstall/8398/
--none--

@markflyhigh
Copy link
Contributor Author

Run Python PostCommit

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.001%) to 70.179% when pulling ba31373 on markflyhigh:python-file-verifier-inconsistency into cc12fd3 on apache:master.

@asfbot
Copy link

asfbot commented Mar 15, 2017

Refer to this link for build results (access rights to CI server needed):
https://builds.apache.org/job/beam_PreCommit_Java_MavenInstall/8419/
--none--

@asfbot
Copy link

asfbot commented Mar 15, 2017

Refer to this link for build results (access rights to CI server needed):
https://builds.apache.org/job/beam_PostCommit_Python_Verify/1509/
--none--

@aaltay
Copy link
Member

aaltay commented Mar 15, 2017

Do you know why the postcommit test failed?

@markflyhigh
Copy link
Contributor Author

From the log in BEAM-1715, the first time when matcher read from gcs only got 3179 lines which is less than expected (4784 lines). I guess the output file is not fully staged at that time, so waiting for few seconds will help.

@markflyhigh
Copy link
Contributor Author

Run Python PostCommit

@coveralls
Copy link

Coverage Status

Coverage increased (+0.002%) to 70.183% when pulling 08037d2 on markflyhigh:python-file-verifier-inconsistency into cc12fd3 on apache:master.

@asfbot
Copy link

asfbot commented Mar 15, 2017

Refer to this link for build results (access rights to CI server needed):
https://builds.apache.org/job/beam_PreCommit_Java_MavenInstall/8456/
--none--

@asfbot
Copy link

asfbot commented Mar 15, 2017

Refer to this link for build results (access rights to CI server needed):
https://builds.apache.org/job/beam_PostCommit_Python_Verify/1517/
--none--

@markflyhigh
Copy link
Contributor Author

Run Python PostCommit

@asfbot
Copy link

asfbot commented Mar 16, 2017

Refer to this link for build results (access rights to CI server needed):
https://builds.apache.org/job/beam_PostCommit_Python_Verify/1522/
--none--

@markflyhigh
Copy link
Contributor Author

PTAL @aaltay

@@ -43,9 +43,11 @@ def test_wordcount_it(self):
output = '/'.join([test_pipeline.get_option('output'),
test_pipeline.get_option('job_name'),
'results'])
sleep_secs = int(test_pipeline.get_option('sleep_secs'))
Copy link
Member

Choose a reason for hiding this comment

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

Did you mean this sleep_secs to be an optional argument or a required one?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

sleep_secs should be optional for wordcount_it_test. You are right, this will break test if no sleep_secs specified. Will fix

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

@markflyhigh
Copy link
Contributor Author

Run Python PostCommit

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.03%) to 70.146% when pulling aefd83a on markflyhigh:python-file-verifier-inconsistency into cc12fd3 on apache:master.

@asfbot
Copy link

asfbot commented Mar 17, 2017

Refer to this link for build results (access rights to CI server needed):
https://builds.apache.org/job/beam_PostCommit_Python_Verify/1534/
--none--

@markflyhigh
Copy link
Contributor Author

PTAL @aaltay

@@ -43,9 +43,12 @@ def test_wordcount_it(self):
output = '/'.join([test_pipeline.get_option('output'),
test_pipeline.get_option('job_name'),
'results'])
arg_sleep_secs = test_pipeline.get_option('sleep_secs')
sleep_time = int(arg_sleep_secs) if arg_sleep_secs is not None else None
Copy link
Member

Choose a reason for hiding this comment

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

sleep_time -> sleep_secs for consistency.

self.sleep_secs = sleep_secs
else:
raise ValueError('Sleep seconds, if received, must be int. '
'But received: %r' % sleep_secs)
Copy link
Member

Choose a reason for hiding this comment

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

consider adding the type information here, might be useful.

@markflyhigh
Copy link
Contributor Author

PTAL @aaltay

@asfbot
Copy link

asfbot commented Mar 22, 2017

Refer to this link for build results (access rights to CI server needed):
https://builds.apache.org/job/beam_PreCommit_Java_MavenInstall/8679/

Build result: FAILURE

[...truncated 580.74 KB...] at hudson.remoting.UserRequest.perform(UserRequest.java:153) at hudson.remoting.UserRequest.perform(UserRequest.java:50) at hudson.remoting.Request$2.run(Request.java:336) at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:68) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang.Thread.run(Thread.java:745)Caused by: org.apache.maven.plugin.MojoFailureException: You have 1 Checkstyle violation. at org.apache.maven.plugin.checkstyle.CheckstyleViolationCheckMojo.execute(CheckstyleViolationCheckMojo.java:588) at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134) at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208) ... 31 more2017-03-22T22:57:40.976 [ERROR] 2017-03-22T22:57:40.976 [ERROR] Re-run Maven using the -X switch to enable full debug logging.2017-03-22T22:57:40.976 [ERROR] 2017-03-22T22:57:40.976 [ERROR] For more information about the errors and possible solutions, please read the following articles:2017-03-22T22:57:40.976 [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException2017-03-22T22:57:40.976 [ERROR] 2017-03-22T22:57:40.976 [ERROR] After correcting the problems, you can resume the build with the command2017-03-22T22:57:40.976 [ERROR] mvn -rf :beam-runners-core-javachannel stoppedSetting status of 0104081 to FAILURE with url https://builds.apache.org/job/beam_PreCommit_Java_MavenInstall/8679/ and message: 'Build finished. 'Using context: Jenkins: Maven clean install
--none--

@aaltay
Copy link
Member

aaltay commented Mar 22, 2017

retest this please

@markflyhigh markflyhigh reopened this Mar 22, 2017
@asfbot
Copy link

asfbot commented Mar 22, 2017

Refer to this link for build results (access rights to CI server needed):
https://builds.apache.org/job/beam_PreCommit_Java_MavenInstall/8681/

Build result: FAILURE

[...truncated 826.43 KB...] at hudson.remoting.UserRequest.perform(UserRequest.java:153) at hudson.remoting.UserRequest.perform(UserRequest.java:50) at hudson.remoting.Request$2.run(Request.java:336) at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:68) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang.Thread.run(Thread.java:745)Caused by: org.apache.maven.plugin.MojoFailureException: You have 1 Checkstyle violation. at org.apache.maven.plugin.checkstyle.CheckstyleViolationCheckMojo.execute(CheckstyleViolationCheckMojo.java:588) at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134) at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208) ... 31 more2017-03-22T23:20:20.140 [ERROR] 2017-03-22T23:20:20.140 [ERROR] Re-run Maven using the -X switch to enable full debug logging.2017-03-22T23:20:20.140 [ERROR] 2017-03-22T23:20:20.140 [ERROR] For more information about the errors and possible solutions, please read the following articles:2017-03-22T23:20:20.140 [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException2017-03-22T23:20:20.140 [ERROR] 2017-03-22T23:20:20.140 [ERROR] After correcting the problems, you can resume the build with the command2017-03-22T23:20:20.141 [ERROR] mvn -rf :beam-runners-core-javachannel stoppedSetting status of 0104081 to FAILURE with url https://builds.apache.org/job/beam_PreCommit_Java_MavenInstall/8681/ and message: 'Build finished. 'Using context: Jenkins: Maven clean install
--none--

@markflyhigh markflyhigh force-pushed the python-file-verifier-inconsistency branch from 0104081 to 3eaf3b4 Compare March 22, 2017 23:33
@coveralls
Copy link

Coverage Status

Coverage decreased (-0.003%) to 70.019% when pulling 3eaf3b4 on markflyhigh:python-file-verifier-inconsistency into eb347bf on apache:master.

@asfbot
Copy link

asfbot commented Mar 23, 2017

Refer to this link for build results (access rights to CI server needed):
https://builds.apache.org/job/beam_PreCommit_Java_MavenInstall/8685/
--none--

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.006%) to 70.016% when pulling 3eaf3b4 on markflyhigh:python-file-verifier-inconsistency into eb347bf on apache:master.

@asfbot
Copy link

asfbot commented Mar 23, 2017

Refer to this link for build results (access rights to CI server needed):
https://builds.apache.org/job/beam_PreCommit_Java_MavenInstall/8687/
--none--

@aaltay
Copy link
Member

aaltay commented Mar 23, 2017

LGTM

@asfbot
Copy link

asfbot commented Mar 23, 2017

Refer to this link for build results (access rights to CI server needed):
https://builds.apache.org/job/beam_PostCommit_Python_Verify/1584/
--none--

@asfgit asfgit closed this in 70efdd0 Mar 23, 2017
@markflyhigh markflyhigh deleted the python-file-verifier-inconsistency branch March 23, 2017 00:36
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.

None yet

4 participants