summaryrefslogtreecommitdiff
path: root/test
Commit message (Collapse)AuthorAgeFilesLines
* Remove SimpleClient, Producer, Consumer, Unittest (#1196)Jeff Widman2019-10-1116-3375/+19
| | | | | | | | | | | | | | | | | | In the 2.0 release, we're removing: * `SimpleClient` * `SimpleConsumer` * `SimpleProducer` * Old partitioners used by `SimpleProducer`; these are superceded by the `DefaultPartitioner` These have been deprecated for several years in favor of `KafkaClient` / `KafkaConsumer` / `KafkaProducer`. Since 2.0 allows breaking changes, we are removing the deprecated classes. Additionally, since the only usage of `unittest` was in tests for these old Simple* clients, this also drops `unittest` from the library. All tests now run under `pytest`.
* Fix describe config for multi-broker clusters (#1869)Jeppe Andersen2019-10-111-1/+56
| | | | | | | * Fix describe config for multi-broker clusters Currently all describe config requests are sent to "least loaded node". Requests for broker configs must, however, be sent to the specific broker, otherwise an error is returned. Only topic requests can be handled by any node. This changes the logic to send all describe config requests to the specific broker.
* convert test_admin_integration to pytest (#1923)Ulrik Johansson2019-10-073-103/+90
|
* Add KAFKA 2.3.0 to test matrix (#1915)Dana Powers2019-09-302-2/+8
|
* Follow up to PR 1782 -- fix tests (#1914)Dana Powers2019-09-301-3/+2
|
* Issue #1780 - Consumer hang indefinitely in fetcher._retrieve_offsets() due ↵Commander Dishwasher2019-09-301-4/+0
| | | | to topic deletion while rebalancing (#1782)
* Send socket data via non-blocking IO with send buffer (#1912)Dana Powers2019-09-291-1/+3
|
* Do not use wakeup when sending fetch requests from consumer (#1911)Dana Powers2019-09-291-1/+1
|
* Rely on socket selector to detect completed connection attempts (#1909)Dana Powers2019-09-282-2/+2
|
* Skip admin integration tests -- travis fixture issuesDana Powers2019-09-281-4/+7
|
* Fix Admin Client api version checking; only test ACL integration on 0.11+Dana Powers2019-09-281-5/+8
|
* Fixup test_admin_integration test fixturesDana Powers2019-09-281-5/+14
|
* Add ACL api to KafkaAdminClient (#1833)Ulrik Johansson2019-09-282-0/+138
|
* Convert remaining `KafkaConsumer` tests to `pytest` (#1886)Jeff Widman2019-08-224-256/+284
| | | | | | | | This makes it so the only remaining use of `unittest` is in the old tests of the deprecated `Simple*` clients. All `KafkaConsumer` tests are migrated to `pytest`. I also had to bump the test iterations up on one of the tests, I think there was a race condition there that was more commonly hit under pytest , planning to cleanup that in a followup PR. See https://github.com/dpkp/kafka-python/pull/1886#discussion_r316860737 for details.
* Cleanup handling of KAFKA_VERSION env var in tests (#1887)Jeff Widman2019-08-2210-142/+65
| | | | | | | | | | | | | Now that we are using `pytest`, there is no need for a custom decorator because we can use `pytest.mark.skipif()`. This makes the code significantly simpler. In particular, dropping the custom `@kafka_versions()` decorator is necessary because it uses `func.wraps()` which doesn't play nice with `pytest` fixtures: - https://github.com/pytest-dev/pytest/issues/677 - https://stackoverflow.com/a/19614807/770425 So this is a pre-requisite to migrating some of those tests to using pytest fixtures.
* Minor test cleanup (#1885)Jeff Widman2019-08-218-11/+25
| | | | Remove unused import, whitespace, etc. No functional changes, just cleaning it up so the diffs of later changes are cleaner.
* tests: Use socket.SOCK_STREAM in assertionsIvan A. Melnikov2019-08-151-4/+4
| | | | | | | | | | | socket.SOCK_STREAM is platform specific and on some platforms (most notably on Linux on MIPS) does not equal 1; so it's better to use the constant where appropriate. This change fixes the tests on my MIPS32 LE machine. Signed-off-by: Ivan A. Melnikov <iv@altlinux.org>
* Sanity test for consumer.topics() and consumer.partitions_for_topic()Brian Sang2019-06-041-0/+9
|
* Reduce client poll timeout when no ifrsDana Powers2019-05-291-0/+12
|
* Update docs for api_version_auto_timeout_ms (#1812)Jeff Widman2019-05-242-5/+27
| | | | | | | | | The docs for `api_version_auto_timeout_ms` mention setting `api_version='auto'` but that value has been deprecated for years in favor of `api_version=None`. Updating the docs for now, and will remove support for `'auto'` in next major version bump.
* Remove unused imports (#1808)Jeff Widman2019-05-221-5/+1
|
* Do not call state_change_callback with lock (#1775)Dana Powers2019-04-021-10/+11
|
* Dont treat popped conn.close() as failure in state change callback (#1773)Dana Powers2019-04-011-2/+3
|
* Dont wakeup during maybe_refresh_metadata -- it is only called by poll() (#1769)Dana Powers2019-03-301-2/+2
|
* Fix flaky conn tests that use time.time (#1758)Dana Powers2019-03-211-9/+12
|
* Generate SSL certificates for local testing (#1756)Dana Powers2019-03-211-0/+29
| | | This doesn't fully implement SSL fixtures, but as a first step it should help with automatically generating required certificates / keystores / etc. My hope is that this helps generate more community support for SSL testing!
* Error if connections_max_idle_ms not larger than request_timeout_ms (#1688)Jeff Widman2019-03-141-2/+6
|
* Retry bootstrapping after backoff when necessary (#1736)Dana Powers2019-03-141-45/+23
| | | | | | | The current client attempts to bootstrap once during initialization, but if it fails there is no second attempt and the client will be inoperable. This can happen, for example, if an entire cluster is down at the time a long-running client starts execution. This commit attempts to fix this by removing the synchronous bootstrapping from `KafkaClient` init, and instead merges bootstrap metadata with the cluster metadata. The Java client uses a similar approach. This allows us to continue falling back to bootstrap data when necessary throughout the life of a long-running consumer or producer. Fix #1670
* Mock dns lookups in test_conn (#1739)Dana Powers2019-03-131-1/+8
| | | Small change to avoid doing dns resolution when running local connection tests. This fixture always returns a broker on localhost:9092, so DNS lookups don't make sense here.
* Recheck connecting nodes sooner when refreshing metadata (#1737)Dana Powers2019-03-131-1/+1
|
* Synchronize puts to KafkaConsumer protocol buffer during async sendsDana Powers2019-03-121-4/+24
|
* Do network connections and writes in KafkaClient.poll() (#1729)Dana Powers2019-03-082-8/+8
| | | | | | * Add BrokerConnection.send_pending_requests to support async network sends * Send network requests during KafkaClient.poll() rather than in KafkaClient.send() * Dont acquire lock during KafkaClient.send if node is connected / ready * Move all network connection IO into KafkaClient.poll()
* Use test.fixtures.version not test.conftest.version to avoid warnings (#1731)Dana Powers2019-03-064-8/+4
|
* Fix test_legacy_correct_metadata_response on x86 arch (#1718)Stanislav Levin2019-02-211-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | The problem is that the type of required operation result is "long". ``` >>> type(278251978 & 0xffffffff) <type 'long'> ``` However, by default "format" method uses __format__(): ``` >>> (278251978 & 0xffffffff).__format__('') '278251978' ``` So, let's compare things using the same engine: ``` >>> "{!r}".format(278251978 & 0xffffffff) '278251978L' ``` Fixes: https://github.com/dpkp/kafka-python/issues/1717 Signed-off-by: Stanislav Levin <slev@altlinux.org>
* Use Popen.communicate() instead of Popen.wait()Brian Sang2019-01-051-9/+10
| | | | | Popen objects may deadlock when using stdout=PIPE or stderr=PIPE with Popen.wait(). Using Popen.communicate() avoids the issue.
* Cleanup formatting, no functional changesJeff Widman2018-11-201-23/+23
| | | | Cleanup the formatting, remove parens, extraneous spaces, etc.
* Be explicit with tuples for %s formattingJeff Widman2018-11-184-7/+7
| | | | Fix #1633
* Migrate from `Unittest` to `pytest` (#1620)Jeff Widman2018-11-106-72/+34
|
* Cleanup fixture importsJeff Widman2018-10-277-15/+10
| | | | | | | | | | | | | | | `random_string` now comes from `test.fixtures` and was being transparently imported via `test.testutil` so this bypasses the pointless indirect import. Similarly, `kafka_version` was transparently imported by `test.testutil` from `test.fixtures`. Also removed `random_port()` in `test.testutil` because its unused as its been replaced by the one in `test.fixtures`. This is part of the pytest migration that was started back in a1869c4be5f47b4f6433610249aaf29af4ec95e5.
* Minor aesthetic cleanup of partitioner testsJeff Widman2018-10-271-11/+10
|
* Remove unused ivy_root variableJeff Widman2018-10-271-1/+0
| | | | This is no longer used anywhere in the codebase
* Add KafkaAdmin classRichard Lee2018-10-241-0/+47
| | | | | | Requires cluster version > 0.10.0.0, and uses new wire protocol classes to do many things via broker connection that previously needed to be done directly in zookeeper.
* Vendor `six` consistentlyJeff Widman2018-10-2210-23/+23
| | | | Use vendored `six`, and also `six.moves.range` rather than `xrange`
* Fix typo in file nameJeff Widman2018-10-221-0/+0
|
* Support produce with Kafka record headersHeikki Nousiainen2018-09-271-1/+9
|
* Expose record headers in ConsumerRecordsHeikki Nousiainen2018-09-271-3/+3
|
* Add positive tests for headers in record encode/decodeHeikki Nousiainen2018-09-272-3/+18
|
* Don't use `kafka.common` internally1.3.5Jeff Widman2018-06-056-13/+14
| | | | This finishes the split from `kafka.common` to `kafka.errors`/`kafka.structs`.
* Ignore MetadataResponses with empty broker list (#1506)Dana Powers2018-05-261-0/+22
|
* Stop shadowing `ConnectionError`Jeff Widman2018-05-233-6/+6
| | | | | | | | | | In Python3, `ConnectionError` is a native exception. So rename our custom one to `KafkaConnectionError` to prevent accidentally shadowing the native one. Note that there are still valid uses of `ConnectionError` in this code. They already expect a native Python3 `ConnectionError`, and also already handle the Python2 compatibility issues.