Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-45988

Snippetizer fails to instantiate PreviousResultsBlock

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Fixed
    • Component/s: performance-plugin
    • Labels:
      None
    • Environment:
      Jenkins v2.70
      Performance Plugin v3.3-SNAPSHOT
      Windows Server 2012
      Oracle Java 1.8.0_66
    • Similar Issues:

      Description

      When configuring the publisher in Expert Mode with a Relative Constraint with option "Compare with number of previous builds", the below exception is thrown, indicating that the PreviousResultsBlock fails to instantiate.

      The cause seems to be a parameter name mismatch: The UI sends

              "previousResultsBlock": { "value": "true", "previousResultsString": "1" },

      (as per radioBlocks in RelativeConstraint/config.jelly), where there is no matching getter/setter, but the binding is done instead via a matching constructor parameter

      @DataBoundConstructor
      public PreviousResultsBlock(String value, String previousResultsString, String timeframeStartString, String timeframeEndString)
      

      As a consequence, the actual value of PreviousResultsBlock.choicePreviousResults is never set, so that the Publisher always will select the builds by date range rather than number of previous builds.

       

      For reference:

      The same problem is described here https://groups.google.com/forum/#!topic/jenkinsci-dev/o2uCY2HkEd8

      And solutions are suggested here: http://jenkins-ci.361315.n4.nabble.com/Can-t-get-radioBlock-value-to-bind-to-constructor-td1748203.html


      Snippet Generator full JSON payload:

      {
          "sourceDataFiles": "test",
          "modePerformancePerTestCase": true,
          "modeThroughput": false,
          "graphType": "ART",
          "modeEvaluation": "true",
          "modeOfThreshold": "false",
          "failBuildIfNoResultFile": false,
          "errorUnstableThreshold": "-1",
          "errorFailedThreshold": "-1",
          "errorUnstableResponseTimeThreshold": "",
          "relativeUnstableThresholdNegative": "",
          "relativeUnstableThresholdPositive": "",
          "relativeFailedThresholdNegative": "",
          "relativeFailedThresholdPositive": "",
          "compareBuildPrevious": "false",
          "nthBuildNumber": "",
          "configType": "ART",
          "ignoreFailedBuilds": true,
          "ignoreUnstableBuilds": true,
          "persistConstraintLog": false,
          "constraints": {
              "relatedPerfReport": "test",
              "meteredValue": "AVERAGE",
              "operator": "NOT_GREATER",
              "tolerance": "12.34",
              "escalationLevel": "INFORMATION",
              "previousResultsBlock": {
                  "value": "true",
                  "previousResultsString": "1"
              },
              "stapler-class": "hudson.plugins.performance.constraints.RelativeConstraint",
              "kind": "hudson.plugins.performance.constraints.RelativeConstraint$DescriptorImpl"
          },
          "stapler-class": "hudson.plugins.performance.PerformancePublisher",
          "$class": "hudson.plugins.performance.PerformancePublisher"
      }

       

       


      Full stacktrace:

      org.jenkinsci.plugins.structs.describable.DescribableParameter uncoerce
      WARNING: failed to uncoerce hudson.plugins.performance.constraints.blocks.PreviousResultsBlock@98d9298
      java.lang.UnsupportedOperationException: no public field ‘value’ (or getter method) found in class hudson.plugins.performance.constraints.blocks.PreviousResultsBlock
              at org.jenkinsci.plugins.structs.describable.DescribableParameter.getValue(DescribableParameter.java:161)
              at org.jenkinsci.plugins.structs.describable.DescribableParameter.inspect(DescribableParameter.java:142)
              at org.jenkinsci.plugins.structs.describable.DescribableModel.uninstantiate2(DescribableModel.java:532)
              at org.jenkinsci.plugins.structs.describable.DescribableModel.uninstantiate2_(DescribableModel.java:622)
              at org.jenkinsci.plugins.structs.describable.DescribableParameter.uncoerce(DescribableParameter.java:196)
              at org.jenkinsci.plugins.structs.describable.DescribableParameter.inspect(DescribableParameter.java:142)
              at org.jenkinsci.plugins.structs.describable.DescribableModel.uninstantiate2(DescribableModel.java:532)
              at org.jenkinsci.plugins.structs.describable.DescribableModel.uninstantiate2_(DescribableModel.java:622)
              at org.jenkinsci.plugins.structs.describable.DescribableParameter.uncoerce(DescribableParameter.java:196)
              at org.jenkinsci.plugins.structs.describable.DescribableParameter.uncoerce(DescribableParameter.java:190)
              at org.jenkinsci.plugins.structs.describable.DescribableParameter.inspect(DescribableParameter.java:142)
              at org.jenkinsci.plugins.structs.describable.DescribableModel.uninstantiate2(DescribableModel.java:532)
              at org.jenkinsci.plugins.structs.describable.DescribableModel.uninstantiate2_(DescribableModel.java:622)
              at org.jenkinsci.plugins.structs.describable.DescribableParameter.uncoerce(DescribableParameter.java:196)
              at org.jenkinsci.plugins.structs.describable.DescribableParameter.inspect(DescribableParameter.java:142)
              at org.jenkinsci.plugins.structs.describable.DescribableModel.uninstantiate2(DescribableModel.java:532)
              at org.jenkinsci.plugins.structs.describable.DescribableModel.uninstantiate2_(DescribableModel.java:622)
              at org.jenkinsci.plugins.workflow.steps.StepDescriptor.uninstantiate(StepDescriptor.java:239)
              at org.jenkinsci.plugins.workflow.cps.Snippetizer.object2Groovy(Snippetizer.java:124)
              at org.jenkinsci.plugins.workflow.cps.Snippetizer.step2Groovy(Snippetizer.java:79)
              at org.jenkinsci.plugins.workflow.cps.Snippetizer.doGenerateSnippet(Snippetizer.java:498)
              at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
              at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
              at java.lang.reflect.Method.invoke(Method.java:498)
              at org.kohsuke.stapler.Function$InstanceFunction.invoke(Function.java:298)
              at org.kohsuke.stapler.Function.bindAndInvoke(Function.java:161)
              at org.kohsuke.stapler.Function.bindAndInvokeAndServeResponse(Function.java:96)
              at org.kohsuke.stapler.MetaClass$1.doDispatch(MetaClass.java:121)
              at org.kohsuke.stapler.NameBasedDispatcher.dispatch(NameBasedDispatcher.java:53)
              at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:746)
              at org.kohsuke.stapler.Stapler.invoke(Stapler.java:876)
              at org.kohsuke.stapler.MetaClass$13.dispatch(MetaClass.java:411)
              at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:746)
              at org.kohsuke.stapler.Stapler.invoke(Stapler.java:876)
              at org.kohsuke.stapler.Stapler.invoke(Stapler.java:649)
              at org.kohsuke.stapler.Stapler.service(Stapler.java:238)
              at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
              at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:812)
              at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1669)
              at hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:132)
              at hudson.util.PluginServletFilter.doFilter(PluginServletFilter.java:123)
              at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652)
              at hudson.security.csrf.CrumbFilter.doFilter(CrumbFilter.java:49)
              at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652)
              at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:84)
              at hudson.security.ChainedServletFilter.doFilter(ChainedServletFilter.java:76)
              at hudson.security.HudsonFilter.doFilter(HudsonFilter.java:171)
              at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652)
              at org.kohsuke.stapler.compression.CompressionFilter.doFilter(CompressionFilter.java:49)
              at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652)
              at hudson.util.CharacterEncodingFilter.doFilter(CharacterEncodingFilter.java:81)
              at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652)
              at org.kohsuke.stapler.DiagnosticThreadNameFilter.doFilter(DiagnosticThreadNameFilter.java:30)
              at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652)
              at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:585)
              at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)
              at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:553)
              at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:223)
              at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1127)
              at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:515)
              at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:185)
              at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1061)
              at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
              at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:215)
              at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:110)
              at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:97)
              at org.eclipse.jetty.server.Server.handle(Server.java:499)
              at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:311)
              at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:257)
              at org.eclipse.jetty.io.AbstractConnection$2.run(AbstractConnection.java:544)
              at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:635)
              at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:555)
              at java.lang.Thread.run(Thread.java:745)

       

       

        Attachments

          Activity

          Hide
          tilln Till Neunast added a comment -
          Show
          tilln Till Neunast added a comment - Possible solution: https://github.com/jenkinsci/performance-plugin/pull/124
          Hide
          artem_fedorov Artem Fedorov added a comment -

          Fixed in https://github.com/jenkinsci/performance-plugin/pull/124
          Will be available in version 3.3

          Thanks!

          Show
          artem_fedorov Artem Fedorov added a comment - Fixed in https://github.com/jenkinsci/performance-plugin/pull/124 Will be available in version 3.3 Thanks!

            People

            • Assignee:
              undera Andrey Pokhilko
              Reporter:
              tilln Till Neunast
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: