Skip to content

Commit

Permalink
publishValgrind immediately, so no need to stash.
Browse files Browse the repository at this point in the history
There may exist an issue with the Jenkins Valgrind plugin, which
confuses the reporting of valgrind memcheck xml results from
multiple stages:

    https://issues.jenkins.io/browse/JENKINS-66073?jql=component%3D16538

This is why we currently stash all valgrind reuslts before reporting on them.

Testing whether this issue does in fact exist -- instead of stashing Valgrind
results, run publishValgrind immediately (in the same stage Valgrind was run).

Signed-off-by: Ethan Mallove <[email protected]>
  • Loading branch information
mallove79 committed Nov 24, 2021
1 parent c571aa2 commit 287a166
Showing 1 changed file with 0 additions and 26 deletions.
26 changes: 0 additions & 26 deletions vars/unitTestPost.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,6 @@
* config['always_script'] Script to run after any test.
* Default 'ci/unit/test_post_always.sh'.
*
* config['skip_post_script'] Skip the running of always_script.
* Default false.
*
* TODO: Always provided, should make required
* config['artifacts'] Artifacts to archive.
* Default ['run_test.sh/*']
Expand All @@ -37,11 +34,6 @@ def call(Map config = [:]) {
String always_script = config.get('always_script',
'ci/unit/test_post_always.sh')

if (!config['skip_post_script']) {
sh label: 'Job Cleanup',
script: always_script
}

Map stage_info = parseStageInfo(config)

if (config['testResults'] != 'None' ) {
Expand Down Expand Up @@ -81,24 +73,6 @@ def call(Map config = [:]) {
log_msg = String.format("tar command '%s' returned rc=%d\n", tar_cmd, rc)
println log_msg
}

// CaRT Valgrind testing
src_files = "**/valgrind.*.memcheck.xml"
target_dir = "valgrind_logs"

fileOperations([fileCopyOperation(excludes: '',
renameFiles: true,
flattenFiles: false,
includes: src_files,
targetLocation: target_dir)])

tar_cmd = "tar -czf ${target_dir}.tar.gz ${target_dir}"
rc = sh(script: tar_cmd, returnStatus: true)
if (rc != 0) {
log_msg = String.format("tar command '%s' returned rc=%d\n", tar_cmd, rc)
println log_msg
}

}

def artifact_list = config.get('artifacts', ['run_test.sh/*'])
Expand Down

1 comment on commit 287a166

@JohnMalmberg
Copy link
Collaborator

Choose a reason for hiding this comment

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

That Jenkins ticket is not why the valgrind plugin was moved to the end of the pipeline job.

The valgrind plugin looks at a number of previous jobs for a build for its trend and blocks until all of those previous jobs have completed..

This does not show up in PRs since we cancel all previous jobs. But it does affect branch builds like master.

When we had multiple stages reporting data to the valgrind plugin in parallel, we had a lot of weird issues related to the valgrind plugin.
It mostly worked, but it did fail a lot of times, and as I recall, logs for the failures was not real helpful.

This was discovered right at the time we moved from having only one stage reporting via the valgrind plugin to having two stages doing the reports.

This was solved by only calling the valgrind plugin once at the end of the job with the stashed results.

Please sign in to comment.