Title: [90114] trunk/Tools
- Revision
- 90114
- Author
- [email protected]
- Date
- 2011-06-30 07:00:16 -0700 (Thu, 30 Jun 2011)
Log Message
Ignore callbacks that correspond to old navigations of the TestFailures page
Fixes <http://webkit.org/b/63711> TestFailures page sometimes ignores back/forward
navigations
Reviewed by Anders Carlsson.
* BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/LayoutTestHistoryAnalyzer.js:
(LayoutTestHistoryAnalyzer.prototype.start): Check the return value of the callback. If the
callback returns false, stop fetching more data.
* BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/ViewController.js:
(ViewController): Initialize new _navigationID member. This member is used to assign each
navigation by the user a unique ID.
(ViewController.prototype.parseHash): Increment the navigation ID.
(ViewController.prototype._displayBuilder):
(ViewController.prototype._displayTesters):
At the start of these functions, record the current navigation ID. Bail out from callbacks
if the navigation ID has changed, indicating that the user has navigated elsewhere.
Modified Paths
Diff
Modified: trunk/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/LayoutTestHistoryAnalyzer.js (90113 => 90114)
--- trunk/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/LayoutTestHistoryAnalyzer.js 2011-06-30 13:59:41 UTC (rev 90113)
+++ trunk/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/LayoutTestHistoryAnalyzer.js 2011-06-30 14:00:16 UTC (rev 90114)
@@ -81,8 +81,8 @@
self._flakinessDetector.possiblyFlakyTests.forEach(function(testName) {
data.possiblyFlaky[testName] = self._flakinessDetector.flakinessExamples(testName);
});
- callback(data, callAgain);
- if (!callAgain)
+ var callbackRequestedStop = !callback(data, callAgain);
+ if (callbackRequestedStop || !callAgain)
return;
setTimeout(function() { inner(nextIndex) }, 0);
});
Modified: trunk/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/ViewController.js (90113 => 90114)
--- trunk/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/ViewController.js 2011-06-30 13:59:41 UTC (rev 90113)
+++ trunk/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/ViewController.js 2011-06-30 14:00:16 UTC (rev 90114)
@@ -27,6 +27,7 @@
this._buildbot = buildbot;
this._bugzilla = bugzilla;
this._trac = trac;
+ this._navigationID = 0;
var self = this;
addEventListener('load', function() { self.loaded() }, false);
@@ -39,6 +40,8 @@
},
parseHash: function(hash) {
+ ++this._navigationID;
+
var match = /#\/(.*)/.exec(hash);
if (match)
this._displayBuilder(this._buildbot.builderNamed(decodeURIComponent(match[1])));
@@ -47,9 +50,14 @@
},
_displayBuilder: function(builder) {
+ var navigationID = this._navigationID;
var self = this;
- var lastDisplay = 0;
(new LayoutTestHistoryAnalyzer(builder)).start(function(data, stillFetchingData) {
+ if (self._navigationID !== navigationID) {
+ // The user has navigated somewhere else. Stop loading data about this tester.
+ return false;
+ }
+
var list = document.createElement('ol');
list.id = 'failure-history';
Object.keys(data.history).forEach(function(buildName, buildIndex, buildNameArray) {
@@ -97,10 +105,14 @@
if (!stillFetchingData)
PersistentCache.prune();
+
+ return true;
});
},
_displayTesters: function() {
+ var navigationID = this._navigationID;
+
var list = document.createElement('ul');
var latestBuildInfos = [];
@@ -123,12 +135,21 @@
});
}
+ var self = this;
this._buildbot.getTesters(function(testers) {
+ if (self._navigationID !== navigationID) {
+ // The user has navigated somewhere else.
+ return;
+ }
testers.forEach(function(tester) {
tester.getMostRecentCompletedBuildNumber(function(buildNumber) {
+ if (self._navigationID !== navigationID)
+ return;
if (buildNumber < 0)
return;
tester.getNumberOfFailingTests(buildNumber, function(failureCount, tooManyFailures) {
+ if (self._navigationID !== navigationID)
+ return;
if (failureCount <= 0)
return;
latestBuildInfos.push({ tester: tester, failureCount: failureCount, tooManyFailures: tooManyFailures });
Modified: trunk/Tools/ChangeLog (90113 => 90114)
--- trunk/Tools/ChangeLog 2011-06-30 13:59:41 UTC (rev 90113)
+++ trunk/Tools/ChangeLog 2011-06-30 14:00:16 UTC (rev 90114)
@@ -1,3 +1,26 @@
+2011-06-30 Adam Roben <[email protected]>
+
+ Ignore callbacks that correspond to old navigations of the TestFailures page
+
+ Fixes <http://webkit.org/b/63711> TestFailures page sometimes ignores back/forward
+ navigations
+
+ Reviewed by Anders Carlsson.
+
+ * BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/LayoutTestHistoryAnalyzer.js:
+ (LayoutTestHistoryAnalyzer.prototype.start): Check the return value of the callback. If the
+ callback returns false, stop fetching more data.
+
+ * BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/ViewController.js:
+ (ViewController): Initialize new _navigationID member. This member is used to assign each
+ navigation by the user a unique ID.
+ (ViewController.prototype.parseHash): Increment the navigation ID.
+
+ (ViewController.prototype._displayBuilder):
+ (ViewController.prototype._displayTesters):
+ At the start of these functions, record the current navigation ID. Bail out from callbacks
+ if the navigation ID has changed, indicating that the user has navigated elsewhere.
+
2011-06-30 Carlos Garcia Campos <[email protected]>
Reviewed by Martin Robinson.
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes