Title: [182770] trunk/Tools
- Revision
- 182770
- Author
- [email protected]
- Date
- 2015-04-13 17:08:29 -0700 (Mon, 13 Apr 2015)
Log Message
build.webkit.org/dashboard shows obsolete results when builds are substantially out of order
https://bugs.webkit.org/show_bug.cgi?id=138630
Reviewed by Tim Horton.
Make sure that we always load at least one in order productive iteration.
* BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/BuildbotQueue.js:
(BuildbotQueue): Added _hasLoadedIterationForInOrderResult to track whether the queue
is done loading at least one iteration that wasn't an out of order build.
(BuildbotQueue.prototype.loadMoreHistoricalIterations): Listen for iteration load
when that's needed to check for out of order builds.
(BuildbotQueue.prototype.update): Ditto.
(BuildbotQueue.prototype._checkForInOrderResult): Check if the queue has an in order
result, and if it does not, load more iterations.
(BuildbotQueue.prototype.loadAll): We have everything loaded, so we certainly have
an in order iteration loaded too.
(BuildbotQueue.prototype.compareIterations): Extracted from sortIterations(), and
corrected to always sort loaded iterations before unloaded ones.
Modified Paths
Diff
Modified: trunk/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/BuildbotQueue.js (182769 => 182770)
--- trunk/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/BuildbotQueue.js 2015-04-14 00:07:35 UTC (rev 182769)
+++ trunk/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/BuildbotQueue.js 2015-04-14 00:08:29 UTC (rev 182770)
@@ -47,6 +47,11 @@
this.iterations = [];
this._knownIterations = {};
+
+ // Some queues process changes out of order, but we need to display results for the latest commit,
+ // not the latest build. BuildbotQueue ensures that at least one productive iteration
+ // that was run in order gets loaded (if the queue had any productive iterations, of course).
+ this._hasLoadedIterationForInOrderResult = false;
};
BaseObject.addConstructorFunctions(BuildbotQueue);
@@ -178,6 +183,8 @@
if (!iteration.loaded) {
if (indexOfFirstNewlyLoadingIteration === undefined)
indexOfFirstNewlyLoadingIteration = i;
+ if (!this._hasLoadedIterationForInOrderResult)
+ iteration.addEventListener(BuildbotIteration.Event.Updated, this._checkForInOrderResult.bind(this));
iteration.update();
}
}
@@ -206,8 +213,11 @@
this._knownIterations[iteration.id] = iteration;
}
- if (i >= loadingStop && (!iteration.finished || !iteration.loaded))
+ if (i >= loadingStop && (!iteration.finished || !iteration.loaded)) {
+ if (!this._hasLoadedIterationForInOrderResult)
+ iteration.addEventListener(BuildbotIteration.Event.Updated, this._checkForInOrderResult.bind(this));
iteration.update();
+ }
}
if (!newIterations.length)
@@ -219,6 +229,22 @@
}.bind(this));
},
+ _checkForInOrderResult: function(event)
+ {
+ if (this._hasLoadedIterationForInOrderResult)
+ return;
+ var iterationsInOriginalOrder = this.iterations.concat().sort(function(a, b) { return b.id - a.id; });
+ for (var i = 0; i < iterationsInOriginalOrder.length - 1; ++i) {
+ var i1 = iterationsInOriginalOrder[i];
+ var i2 = iterationsInOriginalOrder[i + 1];
+ if (i1.productive && i2.loaded && this.compareIterations(i1, i2) < 0) {
+ this._hasLoadedIterationForInOrderResult = true;
+ return;
+ }
+ }
+ this.loadMoreHistoricalIterations();
+ },
+
loadAll: function(callback)
{
// FIXME: Don't load everything at once, do it incrementally as requested.
@@ -232,25 +258,32 @@
this.sortIterations();
+ this._hasLoadedIterationForInOrderResult = true;
+
callback(this);
}.bind(this));
},
- sortIterations: function()
+ compareIterations: function(a, b)
{
- function compareIterations(a, b)
- {
- var result = b.openSourceRevision - a.openSourceRevision;
- if (result)
- return result;
+ var result = b.openSourceRevision - a.openSourceRevision;
+ if (result)
+ return result;
- result = b.internalRevision - a.internalRevision;
- if (result)
- return result;
+ result = b.internalRevision - a.internalRevision;
+ if (result)
+ return result;
- return b.id - a.id;
- }
+ // A loaded iteration may not have revision numbers if it failed early, before svn steps finished.
+ result = b.loaded - a.loaded;
+ if (result)
+ return result;
- this.iterations.sort(compareIterations);
+ return b.id - a.id;
+ },
+
+ sortIterations: function()
+ {
+ this.iterations.sort(this.compareIterations);
}
};
Modified: trunk/Tools/ChangeLog (182769 => 182770)
--- trunk/Tools/ChangeLog 2015-04-14 00:07:35 UTC (rev 182769)
+++ trunk/Tools/ChangeLog 2015-04-14 00:08:29 UTC (rev 182770)
@@ -1,3 +1,25 @@
+2015-04-13 Alexey Proskuryakov <[email protected]>
+
+ build.webkit.org/dashboard shows obsolete results when builds are substantially out of order
+ https://bugs.webkit.org/show_bug.cgi?id=138630
+
+ Reviewed by Tim Horton.
+
+ Make sure that we always load at least one in order productive iteration.
+
+ * BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/BuildbotQueue.js:
+ (BuildbotQueue): Added _hasLoadedIterationForInOrderResult to track whether the queue
+ is done loading at least one iteration that wasn't an out of order build.
+ (BuildbotQueue.prototype.loadMoreHistoricalIterations): Listen for iteration load
+ when that's needed to check for out of order builds.
+ (BuildbotQueue.prototype.update): Ditto.
+ (BuildbotQueue.prototype._checkForInOrderResult): Check if the queue has an in order
+ result, and if it does not, load more iterations.
+ (BuildbotQueue.prototype.loadAll): We have everything loaded, so we certainly have
+ an in order iteration loaded too.
+ (BuildbotQueue.prototype.compareIterations): Extracted from sortIterations(), and
+ corrected to always sort loaded iterations before unloaded ones.
+
2015-04-10 Brent Fulgham <[email protected]>
Expand test infrastructure to support scrolling tests
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes