Commit Graph

133 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 427a16cb08 Fix SyntaxWarning
SyntaxWarning: "is not" with a literal. Did you mean "!="?
Change-Id: Iedfb1bc5fd444109f9239eb7aeb57983883acf0f
2023-07-10 14:35:37 -07:00
Zuul f4a1509534 Merge "py3: Fix distributed benchmarking" 2023-05-16 19:47:01 +00:00
Zuul be8295eda4 Merge "Use unversioned templates" 2023-02-17 22:26:00 +00:00
Tim Burke db047a71e9 Fix tox.ini to work with tox4
Also, update our minversion to match swift.

Change-Id: I3d0cd6ef11f010f79367598dbb242121c7348d4d
2023-02-17 09:28:48 -08:00
Tim Burke 23aba5291e py3: Fix distributed benchmarking
Change-Id: I52b38ca4ccaec0b77d333a710e238300679cf86b
2023-02-16 18:41:37 -08:00
Takashi Kajinami d3db1eaeb3 Use unversioned templates
... because swift-benach follows the independent release model.

Change-Id: I8650ef4f6145849076b6fdda46151a7d3eaa677d
2022-07-22 23:31:59 +09:00
HeroicHitesh 7d3192cdee Migrate from testr to stestr
Replace .testr.conf by .stestr.conf for migration and update
.gitignore, tox.ini and test-requirements.txt files accordingly

Signed-off-by: HeroicHitesh <email.hiteshkumar@gmail.com>
Change-Id: I0948bd22e257285c77fb61564684ab31080ecf54
2021-06-30 19:21:39 -07:00
Zuul 50e1e58fe8 Merge "Use py3 as the default runtime for tox" 2021-07-01 01:30:08 +00:00
Zuul b1d91adda7 Merge "Switch to xena jobs" 2021-07-01 01:24:59 +00:00
zhangboye 9d708e6c90 Use py3 as the default runtime for tox
Moving on py3 as the default runtime for tox to avoid to update
this at each new cycle.

Change-Id: I8225f85caa5db84d10eef91a7948306d98ba8962
2021-06-30 18:19:51 -07:00
Tim Burke 457f368f62 Switch to xena jobs
Change-Id: If21c091da5bd1648945028c20b78b6dd3bf1e856
2021-06-30 16:56:12 -07:00
Zuul f5096bf6c8 Merge "Drop testing for py27" 2021-06-30 23:54:29 +00:00
Tim Burke 8845f72f40 py2: Import print function
Change-Id: Ia1e326d52efdddd3b97fa1c2296de7d1b5589f09
Related-Change: I46c196c389f9425c398506a4abe4dd0abed7ade9
2020-07-20 13:25:52 -07:00
Tim Burke 7d0046069a Drop testing for py27
Change-Id: Ib04148b0705beb6ae0e3d2bf6b80df0e6387a31d
2020-07-16 15:06:18 -07:00
Tim Burke 4539128ffc py3: Fix sigint handler
Change-Id: I46c196c389f9425c398506a4abe4dd0abed7ade9
2020-07-14 12:52:10 -07:00
xuanyandong 31d474723c Switch to Ussuri jobs
Change-Id: I07ef97c59658bda1f46817179164bf306718569b
2019-10-25 11:00:18 +08: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
OpenDev Sysadmins 6e047b640d OpenDev Migration Patch
This commit was bulk generated and pushed by the OpenDev sysadmins
as a part of the Git hosting and code review systems migration
detailed in these mailing list posts:

http://lists.openstack.org/pipermail/openstack-discuss/2019-March/003603.html
http://lists.openstack.org/pipermail/openstack-discuss/2019-April/004920.html

Attempts have been made to correct repository namespaces and
hostnames based on simple pattern matching, but it's possible some
were updated incorrectly or missed entirely. Please reach out to us
via the contact information listed at https://opendev.org/ with any
questions you may have.
2019-04-19 19:36:56 +00:00
Zuul b69aab178b Merge "Change openstack-dev to openstack-discuss" 2019-01-04 00:38:43 +00:00
Tim Burke e1acba9154 Add long_description to fix gate
With https://github.com/pypa/twine/commit/125b772 this will not be
necessary, but may as well fix the warning that would get generated.

Apparently this has been broken ever since PTI started using twine, back
in https://github.com/openstack-infra/project-config/commit/38e40c5

Change-Id: I577883ccc9441cd0eb12eae02149874c736f25a3
2019-01-03 14:25:12 -08:00
ZhijunWei fb57d21856 Change openstack-dev to openstack-discuss
Change-Id: I64d6a472718576095657f0767ff60da6e62c683f
2018-12-04 23:37:36 -05:00
Nguyen Hai c82ac0d7e0 import zuul job settings from project-config
This is a mechanically generated patch to complete step 1 of moving
the zuul job settings out of project-config and into each project
repository.

Because there will be a separate patch on each branch, the branch
specifiers for branch-specific jobs have been removed.

Because this patch is generated by a script, there may be some
cosmetic changes to the layout of the YAML file(s) as the contents are
normalized.

See the python3-first goal document for details:
https://governance.openstack.org/tc/goals/stein/python3-first.html

Change-Id: I3c98411e9ff1840a721933e4fa23f770dc0835d5
Story: #2002586
Task: #24337
2018-08-24 16:38:11 +09:00
Zuul df62f56c97 Merge "Remove discover from test-requirements" 2017-10-20 01:54:08 +00:00
Luong Anh Tuan 63140645a8 Replace assertEquals with assertEqual
The method assertEquals has been deprecated since python 2.7.
http://docs.python.org/2/library/unittest.html#deprecated-aliases

Also in Python 3, a deprecated warning is raised when using assertEquals
therefore we should use assertEqual instead.

This is part of blueprint assertequal

Change-Id: Ie6b881f594c0b3e7015e70a12d7ac720fa765736
2016-11-21 15:59:11 +07:00
reedip b6b1e42fce Remove support for py33/py26
Python 3.3/Python 2.6 is not supported from Mitaka, as per Infra.
The following patch removes the support for the same.

Change-Id: I7c8a1a39f0e86cbd38466c2dcd611a8f513c8adc
Closes-Bug: #1526170
2016-09-10 04:11:32 +00:00
Swapnil Kulkarni (coolsvap) 7d5c39d593 Remove discover from test-requirements
It's only needed for python < 2.7 which is not supported

Change-Id: I794ed96bcc6b2a6d2fd83e67e485a3a099f26ca6
2016-07-21 08:44:49 +00:00
Jenkins f773f17927 Merge "Put py34 first in the env order of tox" 2016-06-08 20:28:13 +00: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 f2354794fc added metadata section to setup.cfg
This is necessary for release tooling.

Change-Id: I96a83be91730ec8ac55502dd738b75a3a2626430
2016-02-12 12:14:01 -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
John Dickinson 0187ce57a9 authors/changelog update for 1.1. release
Change-Id: I472fb72bfaf90a11b11e4d802da3981325a95408
2016-02-11 15:07:21 -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
Janonymous 9e41cb329d Put py34 first in the env order of tox
To solve the problem of "db type could not be determined" on
py34 we have to run py34 env before py27.
This patch puts py34 first on the tox.ini's list of envs
to avoid this problem to happen.

Change-Id: Ife0c57c0d92d41018862aad744ef9af65ef87b21
Closes-bug: #1489059
2016-01-28 08:40:34 +00:00
Ondřej Nový 035134dc5f Bump eventlet min version to 0.17.4
Keep eventlet version same as Swift dependency.
This update matches the OpenStack global requirements version.

Change-Id: Ic8136901a6bc6447ea7248ed3e699ed0f9c0448a
2016-01-22 20:22:14 +01:00
dharmendra 4d9148b04b Pass environment variables of proxy to tox
When a development environment is under a proxy, tox is failed even if
environment variables of the proxy are set.
This patch fixes this problem.

Change-Id: I5382f1b2100ba15fb4a6f501d3885984a68579ab
2016-01-06 16:58:42 +05:30
Ondřej Nový 815486005d Deprecated tox -downloadcache option removed
Caching is enabled by default from pip version 6.0

More info:
https://testrun.org/tox/latest/config.html#confval-downloadcache=path
https://pip.pypa.io/en/stable/reference/pip_install/#caching

Change-Id: I1fe8420806ea45ebc3d455f281bdbe49e0d94e7c
2015-12-11 21:28:20 +01: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
Christian Schwede ae51e6b26f Fix bug when using --log-level option
Fixes a bug when using the --log-level/-o option. These are currently not
usable, because a condition always exits if there are not exactly two
command-line arguments used (the ip and port).

This patch also ensures that the used log-level settings are valid choices.

Change-Id: I5d64e57b59947c059924fce3e458cfe9fa284318
2015-04-20 07:37:53 +00:00
Samuel Merritt 418ae6f13a Clean up some conf parsing
Change-Id: Idba39e06e3db8eca84f3cef8c597ad222cf6d532
2014-10-13 17:57:03 -07: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
Jeremy Stanley a8e161ba70 Work toward Python 3.4 support and testing
Change-Id: I68943058d613387ea5bb675dc720148318989afd
2014-09-03 19:06:14 +00:00