Skip to content

Wait for the HTTP response in the PR reporter - #835

Merged
pablogsal merged 2 commits into
python:mainfrom
pablogsal:fix-pr-reporter-response
Nov 20, 2026
Merged

pablogsal merged 2 commits into
python:mainfrom
pablogsal:fix-pr-reporter-response

Conversation

@pablogsal

Copy link
Copy Markdown
Member

The code that posts build failures to GitHub returns before the HTTP request is complete. The caller then treats the unfinished request as a response and fails with the error below. Wait for the POST request to finish before the reporter returns its response.

File "/srv/buildbot/master/custom/pr_reporter.py", line 184, in sendMessage
    content = yield response.content()
builtins.AttributeError: 'Deferred' object has no attribute 'content'

@pablogsal

Copy link
Copy Markdown
Member Author

CC @zware

@zware zware left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The actual change looks fine and I'm on board with adding proper testing. A couple of quibbles on how to trigger the tests, and the content of the test itself.

Comment thread tests/test_pr_reporter.py Outdated
self.assertNoResult(result)
response = mock.Mock(code=201)
pending.callback(response)
self.assertIs(self.successResultOf(result), response)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

TBH, there's so much mocking here that I'm not sure how useful this is as a test.

Comment thread .github/workflows/check.yml Outdated
- name: Check configuration
run: make check PIP=pip BUILDBOT=buildbot PYTHON_VERSION=${{ matrix.python-version }}
- name: Check custom components
run: PYTHONPATH=master python -m unittest discover -s tests

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Can we fold this into make check?

@pablogsal
pablogsal merged commit 5bf22cb into python:main Nov 20, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants