If you think a bug might affect users in the 57 release, please set the correct tracking and status flags for Release Management.

Block external HTTP requests whilst running the Python test suite

RESOLVED FIXED

Status

Tree Management
Treeherder: Docs & Development
P2
normal
RESOLVED FIXED
4 months ago
3 months ago

People

(Reporter: emorley, Assigned: emorley)

Tracking

(Depends on: 1 bug)

Details

Attachments

(1 attachment)

(Assignee)

Description

4 months ago
We've had a few cases where we've accidentally made Python unit tests depend on external resources (eg logs on S3), which means the tests fail when offline, plus result in non-deterministic behaviour when S3 is being flaky or the logs are expired.

Let's just block all external requests during the pytest run to prevent this from happening.

In order for this to have caught bug 1370229, we'll also need to stop the exceptions being swallowed (bug 1370246).
(Assignee)

Updated

4 months ago
Depends on: 1370229

Comment 1

4 months ago
Created attachment 8876222 [details] [review]
[treeherder] mozilla:block-unmocked-requests > mozilla:master
(Assignee)

Updated

4 months ago
Attachment #8876222 - Flags: review?(cdawson)
Comment on attachment 8876222 [details] [review]
[treeherder] mozilla:block-unmocked-requests > mozilla:master

There was one small change request, but I didn't bother to make a "request for change" so I don't slow you down.  Thanks for catching and fixing this.  :)
Attachment #8876222 - Flags: review?(cdawson) → review+

Comment 3

3 months ago
Commit pushed to master at https://github.com/mozilla/treeherder

https://github.com/mozilla/treeherder/commit/c6432016947fbd2dea128abd5710986450854b68
Bug 1370249 - Block unmocked HTTP requests during Python tests

This prevents tests from inadvertently depending on external resources
(for example logs on S3) due to missing mocked responses.
(Assignee)

Updated

3 months ago
Status: ASSIGNED → RESOLVED
Last Resolved: 3 months ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.