From 6b0f4497f652cf5407131456ff164d63f7c258d9 Mon Sep 17 00:00:00 2001 From: Randy Barlow Date: Tue, 27 Sep 2016 12:07:33 -0400 Subject: [PATCH] Only show non-passing taskotron results when more than 16 builds. Taskotron recently began to return a large number of test results per-package. For updates with many packages, this was causing browsers to use a whole lot of memory rendering all the results. This commit adjusts the logic so that only non-passing results are displayed on updates with more than 16 builds. re #951 --- bodhi/server/templates/update.html | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/bodhi/server/templates/update.html b/bodhi/server/templates/update.html index a06335bd02..16fbc6c460 100644 --- a/bodhi/server/templates/update.html +++ b/bodhi/server/templates/update.html @@ -158,14 +158,19 @@ // Then, once we have pruned, build a bunch of cells and render each // result in the table $.each(data, function(i, result) { - $('#resultsdb table').append(make_row( - result.outcome, - result.testcase.name, - result.result_data.item, - result.result_data.arch, - result.submit_time, - result.log_url - )); + // When there are many builds in an update, the large number of taskotron results can be a + // problem for browsers. Only show the non-passing results in this case. + // See https://github.com/fedora-infra/bodhi/issues/951 + if (builds.length < 16 || result.outcome != "PASSED") { + $('#resultsdb table').append(make_row( + result.outcome, + result.testcase.name, + result.result_data.item, + result.result_data.arch, + result.submit_time, + result.log_url + )); + } }); finish(); @@ -228,6 +233,9 @@ } + if (builds.length > 16) { + $("

Large update detected: passing test results filtered.

").insertBefore('#resultsdb table'); + } // Kick off a few chains of paginated queries. One for each of the // possible testcases. gather_testcases(base_url + 'testcases');