Changeset 85821 in webkit


Ignore:
Timestamp:
May 4, 2011 7:24:04 PM (13 years ago)
Author:
eric@webkit.org
Message:

2011-05-04 Eric Seidel <eric@webkit.org>

Reviewed by Adam Barth.

sheriff-bot is having more exception trouble
https://bugs.webkit.org/show_bug.cgi?id=60233

A webpage-forced build was causing SB to throw an exception.
We've long had this bug, but we just didn't notice it until now.

In debugging this I found we fetch an absurd amount of data now
that we use buildbot's json (instead of xmlrpc), so I added
the filter=1 parameter to reduce it a little. That required
me to handle the case where filter=1 would strip
result=0 in some cases (it's unclear why it does that).

  • Scripts/webkitpy/common/net/buildbot/buildbot.py:
  • Scripts/webkitpy/common/net/buildbot/buildbot_unittest.py:
Location:
trunk/Tools
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Tools/ChangeLog

    r85816 r85821  
     12011-05-04  Eric Seidel  <eric@webkit.org>
     2
     3        Reviewed by Adam Barth.
     4
     5        sheriff-bot is having more exception trouble
     6        https://bugs.webkit.org/show_bug.cgi?id=60233
     7
     8        A webpage-forced build was causing SB to throw an exception.
     9        We've long had this bug, but we just didn't notice it until now.
     10
     11        In debugging this I found we fetch an absurd amount of data now
     12        that we use buildbot's json (instead of xmlrpc), so I added
     13        the filter=1 parameter to reduce it a little.  That required
     14        me to handle the case where filter=1 would strip
     15        result=0 in some cases (it's unclear why it does that).
     16
     17        * Scripts/webkitpy/common/net/buildbot/buildbot.py:
     18        * Scripts/webkitpy/common/net/buildbot/buildbot_unittest.py:
     19
    1202011-05-04  Cris Neckar  <cdn@chromium.org>
    221
  • trunk/Tools/Scripts/webkitpy/common/net/buildbot/buildbot.py

    r85080 r85821  
    7878        if not build_dictionary:
    7979            return None
     80        revision_string = build_dictionary['sourceStamp']['revision']
    8081        return Build(self,
    8182            build_number=int(build_dictionary['number']),
    82             revision=int(build_dictionary['sourceStamp']['revision']),
    83             is_green=(build_dictionary['results'] == 0) # Undocumented, 0 seems to mean "pass"
     83            # 'revision' may be None if a trunk build was started by the force-build button on the web page.
     84            revision=(int(revision_string) if revision_string else None),
     85            # Buildbot uses any nubmer other than 0 to mean fail.  Since we fetch with
     86            # filter=1, passing builds may contain no 'results' value.
     87            is_green=(not build_dictionary.get('results')),
    8488        )
    8589
     
    376380    # FIXME: These _fetch methods should move to a networking class.
    377381    def _fetch_build_dictionary(self, builder, build_number):
     382        # Note: filter=1 will remove None and {} and '', which cuts noise but can
     383        # cause keys to be missing which you might otherwise expect.
     384        # FIXME: The bot sends a *huge* amount of data for each request, we should
     385        # find a way to reduce the response size further.
     386        json_url = "http://%s/json/builders/%s/builds/%s?filter=1" % (self.buildbot_host, urllib.quote(builder.name()), build_number)
    378387        try:
    379             base = "http://%s" % self.buildbot_host
    380             path = urllib.quote("json/builders/%s/builds/%s" % (builder.name(),
    381                                                                 build_number))
    382             url = "%s/%s" % (base, path)
    383             jsondata = urllib2.urlopen(url)
    384             return json.load(jsondata)
     388            return json.load(urllib2.urlopen(json_url))
    385389        except urllib2.URLError, err:
    386390            build_url = Build.build_url(builder, build_number)
    387             _log.error("Error fetching data for %s build %s (%s): %s" % (builder.name(), build_number, build_url, err))
     391            _log.error("Error fetching data for %s build %s (%s, json: %s): %s" % (builder.name(), build_number, build_url, json_url, err))
    388392            return None
    389393        except ValueError, err:
  • trunk/Tools/Scripts/webkitpy/common/net/buildbot/buildbot_unittest.py

    r82313 r85821  
    116116        for filename, revision_and_build in expectations.items():
    117117            self.assertEqual(self.builder._revision_and_build_for_filename(filename), revision_and_build)
     118
     119    def test_fetch_build(self):
     120        buildbot = BuildBot()
     121        builder = Builder(u"Test Builder \u2661", buildbot)
     122
     123        def mock_fetch_build_dictionary(self, build_number):
     124            build_dictionary = {
     125                "sourceStamp": {
     126                    "revision": None,  # revision=None means a trunk build started from the force-build button on the builder page.
     127                    },
     128                "number": int(build_number),
     129                # Intentionally missing the 'results' key, meaning it's a "pass" build.
     130            }
     131            return build_dictionary
     132        buildbot._fetch_build_dictionary = mock_fetch_build_dictionary
     133        self.assertNotEqual(builder._fetch_build(1), None)
    118134
    119135
  • trunk/Tools/Scripts/webkitpy/tool/commands/earlywarningsystem.py

    r85802 r85821  
    141141        except ScriptError, e:
    142142            # FIXME: This should just use CommitterValidator.reject_patch_from_commit_queue
    143             self._post_reject_message_on_bug(patch)
     143            self._post_reject_message_on_bug(task, patch)
    144144            results_archive = task.results_archive_from_patch_test_run(patch)
    145145            if results_archive:
Note: See TracChangeset for help on using the changeset viewer.