Commit Graph

24 Commits

Author SHA1 Message Date
Thomas Goirand 666fc883fa Removed Python 2 support and six
Remove the use of six and move forward with Python3 only.

Change-Id: Ia4694704e001df03ac489a4d8a491c1c784ec3f9
2024-03-11 12:50:42 +01:00
Tim Burke e8eb9511d2 Catch connection errors and count them as failures
Previously we'd get tracebacks like this during a proxy reload:

Traceback (most recent call last):
  File ".../urllib3/connectionpool.py", line 791, in urlopen
    response = self._make_request(
  File ".../urllib3/connectionpool.py", line 537, in _make_request
    response = conn.getresponse()
  File ".../urllib3/connection.py", line 461, in getresponse
    httplib_response = super().getresponse()
  File ".../http/client.py", line 1375, in getresponse
    response.begin()
  File ".../http/client.py", line 318, in begin
    version, status, reason = self._read_status()
  File ".../http/client.py", line 287, in _read_status
    raise RemoteDisconnected("Remote end closed connection without"
http.client.RemoteDisconnected: Remote end closed connection without response

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File ".../requests/adapters.py", line 486, in send
    resp = conn.urlopen(
  File ".../urllib3/connectionpool.py", line 845, in urlopen
    retries = retries.increment(
  File ".../urllib3/util/retry.py", line 470, in increment
    raise reraise(type(error), error, _stacktrace)
  File ".../urllib3/util/util.py", line 38, in reraise
    raise value.with_traceback(tb)
  File ".../urllib3/connectionpool.py", line 791, in urlopen
    response = self._make_request(
  File ".../urllib3/connectionpool.py", line 537, in _make_request
    response = conn.getresponse()
  File ".../urllib3/connection.py", line 461, in getresponse
    httplib_response = super().getresponse()
  File ".../http/client.py", line 1375, in getresponse
    response.begin()
  File ".../http/client.py", line 318, in begin
    version, status, reason = self._read_status()
  File ".../http/client.py", line 287, in _read_status
    raise RemoteDisconnected("Remote end closed connection without"
urllib3.exceptions.ProtocolError: ('Connection aborted.', RemoteDisconnected('Remote end closed connection without response'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File ".../eventlet/greenpool.py", line 88, in _spawn_n_impl
    func(*args, **kwargs)
  File ".../swiftbench/bench.py", line 477, in _run
    client.get_object(self.url, self.token,
  File ".../swiftclient/client.py", line 1252, in get_object
    conn.request(method, path, '', headers)
  File ".../swiftclient/client.py", line 416, in request
    self.resp = self._request(method, url, headers=headers, data=data,
  File ".../swiftclient/client.py", line 400, in _request
    return self.request_session.request(*arg, **kwarg)
  File ".../requests/sessions.py", line 589, in request
    resp = self.send(prep, **send_kwargs)
  File ".../requests/sessions.py", line 703, in send
    r = adapter.send(request, **kwargs)
  File ".../requests/adapters.py", line 501, in send
    raise ConnectionError(err, request=request)
requests.exceptions.ConnectionError: ('Connection aborted.', RemoteDisconnected('Remote end closed connection without response'))

Change-Id: Idd1a83afd2c4dbf7305c19d3ec3974961e500620
2023-11-08 11:38:12 -08:00
Matthew Oliver 5f803ae8fd refactor bin/bench into swiftbench/cli for testing
The test infrastructure for swiftbench is pretty bad. In order to start
cleaning it up this patch starts with some initial scaffolding for
test_cli.py. Sd such it refactors the code out of bin/swiftbench and
puts it into swiftbench/cli/__init__.py. Leaving the cli namespace free
for future expansions.

A very basic tests/test_cli.py has been added which initialises some test
scaffolding. Additionally, fix some bugs this uncovered:

- The --delete-concurrency option now actually has an effect.
- Stop mutating global state on every run.

Partial-Bug: #1263290
Change-Id: Ibb2c3bb17522b6302697e2d2b01df3a6aa62800e
2023-07-10 15:42:23 -07:00
Tim Burke 23aba5291e py3: Fix distributed benchmarking
Change-Id: I52b38ca4ccaec0b77d333a710e238300679cf86b
2023-02-16 18:41:37 -08:00
Tim Burke 8845f72f40 py2: Import print function
Change-Id: Ia1e326d52efdddd3b97fa1c2296de7d1b5589f09
Related-Change: I46c196c389f9425c398506a4abe4dd0abed7ade9
2020-07-20 13:25:52 -07:00
Tim Burke 4539128ffc py3: Fix sigint handler
Change-Id: I46c196c389f9425c398506a4abe4dd0abed7ade9
2020-07-14 12:52:10 -07:00
Tim Burke fc53cbf147 Allow users to specify object sizes with k/M/G suffixes
Change-Id: Ie8671e2313b76376d123c9d4eafcc1aff44ba0b8
2019-08-29 13:17:24 -07:00
Tim Burke f221632a82 Port to py3
Change-Id: Ib86178259f854c15dd305dd39779a203cafb0451
2019-08-29 13:16:33 -07:00
John Dickinson 7b083851bb version bump to open 1.2.1 dev work
Change-Id: I2fa98e3cd706ab9dbc022288a8540f063ea9498c
2016-02-12 12:23:35 -08:00
John Dickinson 24d8761190 version bump for 1.2 release
Change-Id: Ief12fe5673369e9445f3f8538a875d8627dd5d0a
2016-02-12 12:17:27 -08:00
John Dickinson c34a750544 version bump to open 1.2 dev work
Change-Id: I50201bafc1f623b1470a8a7f2c36002c925db3f0
2016-02-11 15:22:09 -08:00
John Dickinson 0fa52e11b8 version bump for 1.1. release
Change-Id: I5a818d5a2a73af45b60fee74f8d190d5111eb275
2016-02-11 15:21:41 -08:00
reedip 5eb2f500fd TrivialFix of Import JSON
As per the comment#12 in [1], the if loop can be removed
and json can be directly imported from bench.py

[1]: https://review.openstack.org/#/c/264486/

TrivialFix
Depends-On:I7c8a1a39f0e86cbd38466c2dcd611a8f513c8adc
Change-Id: I519753b0db0d8eee70c84afa92dfab2b943afbac
2016-01-29 00:54:43 +00:00
Jenkins 94e101148d Merge "update hacking in test-requirements" 2015-11-24 15:38:33 +00:00
John Dickinson 43dc3dd358 update hacking in test-requirements
also changed a variable name to pass a new hacking check

Change-Id: Ib64adcc6c986528e619ee42abc21f42f9f2dfbf4
2015-11-09 15:35:14 -08:00
Ondrej Novy c0f473d975 Try to detect HTTP proxy and warn about it.
swift-bench test results could be altered when using HTTP proxy server.
This patch add warning when HTTP proxy has been detected.

Change-Id: Id818203345914efee37852e96541c259de6ae555
2015-10-05 21:57:06 +02:00
Thiago da Silva d64b007deb add storage policy option
provide ability for user to select which storage policy
to run benchmark against

Change-Id: I9973f964ec3989281f47f853be053498e7a6e51e
Signed-off-by: Thiago da Silva <thiago@redhat.com>
2015-06-01 17:56:25 +00:00
Samuel Merritt 5dac34716b Fix next on SourceFile
next(iterable) is supposed to return the next thing in the sequence;
here, that's a bunch of zeros. However, this was returning a generator
that yielded one item: a bunch of zeros. This broke direct
benchmarking.

Change-Id: I2fca4795fc9b3d1637c72616a52a60482d6e853e
2014-10-13 16:43:01 -07:00
Chmouel Boudjnah e1425fc8bb Remove gettext.
This was hardly used and remove a dependence on main swift.

Change-Id: I29b3a0cdeb00b4414d6fed9e1ab0a63b54c1539a
2014-01-14 16:28:00 +00:00
John Dickinson 1e3ac5cb08 version bump to open 1.1 dev work
Change-Id: I10c1e928e5ddb3a89ea8767964f0735f13f873e8
2013-12-05 14:18:03 -08:00
John Dickinson 1dac5c4745 version bump for 1.0 release
Change-Id: Ia50c3f50aa306b4c8c9519ce9b58315e4b14b263
2013-12-05 14:16:23 -08:00
John Dickinson cf0f1d1da9 fixed log formatter issues
Change-Id: Ie567b59943029f3ae569576b5c8f1d0942a36a0a
2013-12-02 11:54:31 -08:00
Chmouel Boudjnah b207aaca07 Make swift-bench not depending on swift.
Remove the dependence on swift, import the only needed functions from
swift.common.utils to swiftbench.utils

Add tests for utils using mock instead.

Change-Id: I1b69dce750b55f3ee0e999fb5a7100cf811f7ebe
2013-11-24 15:35:49 +01:00
Chmouel Boudjnah 64b976e139 Add plumbing.
- Update .gitignore to ignore all testrunners.
- Move swift-bench to swiftbench.
- Move tests to tests/
- Add some simple {test-,}requirements (more works needs to be done to get proper versioning)

Change-Id: Iab4d65f02cbce8c99ecafa30d15c4cb11f0b4293
2013-11-21 14:09:47 -08:00