Re: Jenkins Performance Plugin provides all reporting as a cumulation of all runs, not just the relevant run for the report.

2019-07-31 Thread Stuart Kenworthy
After a bit more of a play around I have identified a workaround, but 
ultimately it was down to unexpected behaviour by both Jenkins and JMeter.

Firstly, Jenkins was not creating a new workspace for every build and was 
not clearing down the workspace after each build. This meant that all 
existing artefacts were still present from previous builds when new builds 
were being started.

Secondly, when starting up, JMeter simply apends to any existing log file 
instead of creating it from scratch.

The combination of the 2 meant that the results.csv file on the Jenkins 
runner was what contained all previous run data, not the perfReport plugin. 
The perfReport plugin appeared to be doing everything correctly.

I have now added a cleardown section to my jenkins file and everything 
looks good.

However I did notice that in failed or unstable builds, the graphs were not 
being populated. This appears to be caused by these conditions causing the 
plugin to fail before generating the reports. A quick fix for this was to 
have 2 perfReport entries in your stage. 1 that creates the reports then 1 
that processes the pass criteria.

stage('Publish report') {
perfReport 'result.csv'
perfReport sourceDataFiles: 'result.csv',
filterRegex: '',
failBuildIfNoResultFile: true,
errorFailedThreshold: 5,
errorUnstableThreshold: 1
}

If anyone has a better solution to this final issue, I am all ears but 
happy with the way it is running now.

On Tuesday, June 18, 2019 at 2:12:03 PM UTC+1, Stuart Kenworthy wrote:
>
> Produced using:
> - Jenkins 1.121.2
> - Performance Plugin 3.15
> - Plot 2.1.0
> - Jmeter 5.1
>
> I have googled, searched this group and search the jenkins issue log and 
> cannot find an example of this being recorded but cannot imagine I am the 
> only one having this issue.
>
> I may be missing something but looking at the Jenkins Performance Plugin 
> "comparison with previous build" graph appears to show the difference 
> between the current report and the previous report, however both reports 
> are just an accumulation of all runs up until that point which pretty much 
> makes any of the reporting provided by the plugin useless.
>
> Say your jmeter script is 10 samplers.Run 1 has 0 failures and run 2 has 
> 100% failure rate, the report looks like this:
>
> *URI | Samples  | Errors*
> Login   | 20 (+10)  | 50% (+50%)
>
> As a comparison to the previous run I would expect it to look like
>
> *URI | Samples  | Errors*
> Login   | 10 (10)| 100% (0%)
>
> Say run 3 was again a clean run the report looks like
>
> *URI | Samples  | Errors*
> Login   | 30 (+10)  | 33.33% (-16.66%)
>
> Once again as a comparison to the previous run I would expect it to look 
> like this as we do not care about the first run in a comparison again the 
> previous build:
>
> *URI | Samples  | Errors*
> Login   | 10 (10)| 0% (100%)
>
> Note I also did not expect a + or - in the adjusted figure as surely this 
> should just contain the last results.
>
> It also appears all the graphs are based on the cumulative figures so the 
> never actually represent the run the seem to represent.
>
> Take this graph for example, we were having downstream issues which 
> resulted in each run hitting a 98% error rate, the last 2 runs were around 
> 25% error rate but rather than the percentage of errors dropping to around 
> 25% to reflect that run, it once again just provides the cumulative error 
> rate of all run before it.
>
>
> Surely it should look like this:
> This also breaks things like threshold checking for build failures which 
> also uses the cumulative figure.
>
> Deleting runs from jenkins also has unesired effects such as reducing the 
> number of samplers in the next report but not previous statistics.
>
> Is there any way to fix this reporting?
>
> Thanks
>

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/94f4e5cb-e4c3-4026-bb13-91f5b89b%40googlegroups.com.


Gerrit plugin to trigger Jenkins job on a particular files change (for example, on change of *.sql)

2019-07-31 Thread Abhijeet Dalal
Hello Team,
   I am looking for gerrit event settings which will trigger a Jenkins job 
only when there are any changes to, say ".sql" files. Thanks!

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/8a6b8bd6-43cd-4607-8006-b9255ed1ffe3%40googlegroups.com.


Socket exception: socket closed

2019-07-31 Thread Sudharsan R
Hi all,
We are using version 2.150.1 of Jenkins
We use kubernetes(plugin version 1.13.7) to run our build pods. The jnlp 
container image is jenkinsci/jnlp-slave:3.26-1-alpine

Our jenkinsfile is as follows:
  stages {
stage('Update Environment') {
  steps {
container('devenv') {
sh "./test.py"
sh "./nextjob.py"
}
  }
}
  }

test.py is as follows:
cnt = 0
while cnt < 10:
time.sleep(180)
print "Sleep "+str(cnt)
cnt = cnt + 1

We see the following error message on the build log while test.py is 
executing
java.net.SocketException: Socket closed
at java.net.SocketInputStream.socketRead0(Native Method)
at java.net.SocketInputStream.socketRead(SocketInputStream.java:116)
at java.net.SocketInputStream.read(SocketInputStream.java:171)
at java.net.SocketInputStream.read(SocketInputStream.java:141)
at sun.security.ssl.InputRecord.readFully(InputRecord.java:465)
at sun.security.ssl.InputRecord.read(InputRecord.java:503)
at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:983)
at sun.security.ssl.SSLSocketImpl.readDataRecord(SSLSocketImpl.java:940)
at sun.security.ssl.AppInputStream.read(AppInputStream.java:105)
at okio.Okio$2.read(Okio.java:139)
at okio.AsyncTimeout$2.read(AsyncTimeout.java:237)
at okio.RealBufferedSource.request(RealBufferedSource.java:67)
at okio.RealBufferedSource.require(RealBufferedSource.java:60)
at okio.RealBufferedSource.readByte(RealBufferedSource.java:73)
at okhttp3.internal.ws.WebSocketReader.readHeader(WebSocketReader.java:113)
at 
okhttp3.internal.ws.WebSocketReader.processNextFrame(WebSocketReader.java:97)
at okhttp3.internal.ws.RealWebSocket.loopReader(RealWebSocket.java:265)
at okhttp3.internal.ws.RealWebSocket$2.onResponse(RealWebSocket.java:204)
at okhttp3.RealCall$AsyncCall.execute(RealCall.java:153)
at okhttp3.internal.NamedRunnable.run(NamedRunnable.java:32)
at 
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
Sleep 0
Sleep 1
Sleep 2
Sleep 3
Sleep 4
Sleep 5
Sleep 6
Sleep 7
Sleep 8
Sleep 9

Once test.py execution is complete, the build is failed and nextjob.py 
never executes.

I made a modification to test.py to flush stdout after each print
cnt = 0
while cnt < 10:
time.sleep(180)
print "Sleep "+str(cnt)
sys.stdout.flush()
cnt = cnt + 1

Everything seems ok! Somehow flushing stdout every 3 minutes or so seems to 
keep the jnlp connection between master and slave up...
The master and the slave are in AWS and are on the same VPC subnet(Dont 
believe that these connections go through any stateful network services 
that can induce resets on idle connections). I don't see much logs of note( 
I may also not be looking at the right ones) on the jenkins master. Are 
there any debugs we can enable on the master to understand what is 
happening? Is this behavior perhaps expected (the build step should not be 
too silent for a long time?)

Help would be much appreciated

Thanks
Sudharsan

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/5c3ea136-8c6a-49ec-aa93-ea330d1d5204%40googlegroups.com.