[BEAM-1148] Port PAssert away from Aggregators#2291
[BEAM-1148] Port PAssert away from Aggregators#2291pabloem wants to merge 3 commits intoapache:masterfrom
Conversation
|
Refer to this link for build results (access rights to CI server needed): Build result: FAILURE[...truncated 823.52 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:12:18.435 [ERROR] 2017-03-22T22:12:18.435 [ERROR] Re-run Maven using the -X switch to enable full debug logging.2017-03-22T22:12:18.435 [ERROR] 2017-03-22T22:12:18.435 [ERROR] For more information about the errors and possible solutions, please read the following articles:2017-03-22T22:12:18.435 [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException2017-03-22T22:12:18.435 [ERROR] 2017-03-22T22:12:18.435 [ERROR] After correcting the problems, you can resume the build with the command2017-03-22T22:12:18.435 [ERROR] mvn -rf :beam-runners-core-javachannel stoppedSetting status of 1234252 to FAILURE with url https://builds.apache.org/job/beam_PreCommit_Java_MavenInstall/8675/ and message: 'Build finished. 'Using context: Jenkins: Maven clean install--none-- |
|
Refer to this link for build results (access rights to CI server needed): Build result: FAILURE[...truncated 849.56 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:36:01.904 [ERROR] 2017-03-22T22:36:01.904 [ERROR] Re-run Maven using the -X switch to enable full debug logging.2017-03-22T22:36:01.904 [ERROR] 2017-03-22T22:36:01.904 [ERROR] For more information about the errors and possible solutions, please read the following articles:2017-03-22T22:36:01.905 [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException2017-03-22T22:36:01.905 [ERROR] 2017-03-22T22:36:01.905 [ERROR] After correcting the problems, you can resume the build with the command2017-03-22T22:36:01.905 [ERROR] mvn -rf :beam-runners-core-javachannel stoppedSetting status of 9711009 to FAILURE with url https://builds.apache.org/job/beam_PreCommit_Java_MavenInstall/8676/ and message: 'Build finished. 'Using context: Jenkins: Maven clean install--none-- |
|
Changes Unknown when pulling 5dcedaa on pabloem:fix-passert into ** on apache:master**. |
|
Refer to this link for build results (access rights to CI server needed): |
tgroh
left a comment
There was a problem hiding this comment.
Test(Apex/Dataflow/Flink)Runner are likely to all be broken after this change, unless there's an equivalent change to get them to use Metrics
Can you split the bug fixes out into a separate PR?
| MetricNameFilter.named(PAssert.class, PAssert.SUCCESS_COUNTER)).build()); | ||
| long successAssertions = 0; | ||
| for (MetricResult<Long> res : queryResults.counters()) { | ||
| successAssertions += res.attempted().longValue(); |
There was a problem hiding this comment.
Successes should be logical. A successful PAssert should be committed exactly once.
There was a problem hiding this comment.
The Spark runner does not support committed metrics. @aviemzur what do you think? We could merge this as is, and file a bug to change it once committed metrics are supported.
There was a problem hiding this comment.
Committed metrics will probably not be supported in Spark runner.
| MetricNameFilter.named(PAssert.class, PAssert.FAILURE_COUNTER)).build()); | ||
| long failedAssertions = 0; | ||
| for (MetricResult<Long> res : queryResults.counters()) { | ||
| failedAssertions += res.attempted().longValue(); |
There was a problem hiding this comment.
(This one should remain attempted - we should never commit the failure, so it should be impossible for the failure counter to ever go above zero in committed - but this does generically mean that we can't be guaranteed to have a completely accurate signal of failed assertions.)
|
I think we should consider instead to move on https://issues.apache.org/jira/browse/BEAM-1763 and remove these assertions from TestSparkRunner. This will also remove the need for #2263 |
|
Tests (especially those with multiple assertions) won't reliably work in the |
|
Not with metrics, no. But @bjchambers had an idea for doing this without metrics, but with sideoutput instead. |
|
That's fair. I'll talk to Ben to figure out how to do this with side outputs. I'll submit the bug fix in a different PR. |
This PR contains the following changes:
PAssert.javacode to use Metrics instead of AggregatorsTestSparkRunner.javacode to use Metrics. The change here also required adding up different Metrics counters because Metrics are per-step; while Aggregators in Spark seem to be adding accross steps.Additional bug fixes/code improvements:
Fixing a bug in
MetricFilteringChanging the Spark runner to use
MetricFilteringinstead of its own filtering implementation - if that's okay : )I ran
mvn clean verifysuccessfully.Are there other places where I should be porting Aggregators checks to Metrics?
@aviemzur @tgroh PTAL