Skip to content

Commit e7e22fd

Browse files
committed
debug
1 parent 3796c2d commit e7e22fd

File tree

4 files changed

+30
-6
lines changed

4 files changed

+30
-6
lines changed

test/service.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ def wait_for(self, pattern, timeout=30):
126126
while True:
127127
if not self.is_alive():
128128
self.join()
129-
#raise RuntimeError("Child thread died already.")
129+
raise RuntimeError("Child thread died already.")
130130

131131
elapsed = time.time() - start
132132
if elapsed >= timeout:

test/test_admin_integration.py

+23
Original file line numberDiff line numberDiff line change
@@ -126,14 +126,37 @@ def test_describe_configs_mixed_resources_returns_configs(topic, kafka_admin_cli
126126
ConfigResource(ConfigResourceType.BROKER, broker_id)])
127127

128128
assert len(configs) == 2
129+
retry = False
129130

131+
for config in configs:
132+
assert (config.resources[0][2] == ConfigResourceType.TOPIC
133+
and config.resources[0][3] == topic) or \
134+
(config.resources[0][2] == ConfigResourceType.BROKER
135+
and config.resources[0][3] == str(broker_id))
136+
#assert len(config.resources[0][4]) > 1
137+
if not (len(config.resources[0][4]) > 1):
138+
retry = True
139+
140+
if not retry:
141+
return
142+
143+
sleep(10)
144+
145+
broker_id = kafka_admin_client._client.cluster._brokers[0].nodeId
146+
configs = kafka_admin_client.describe_configs([
147+
ConfigResource(ConfigResourceType.TOPIC, topic),
148+
ConfigResource(ConfigResourceType.BROKER, broker_id)])
149+
150+
assert len(configs) == 2
130151
for config in configs:
131152
assert (config.resources[0][2] == ConfigResourceType.TOPIC
132153
and config.resources[0][3] == topic) or \
133154
(config.resources[0][2] == ConfigResourceType.BROKER
134155
and config.resources[0][3] == str(broker_id))
135156
assert len(config.resources[0][4]) > 1
136157

158+
assert False
159+
137160

138161
@pytest.mark.skipif(env_kafka_version() < (0, 11), reason="Describe config features require broker >=0.11")
139162
def test_describe_configs_invalid_broker_id_raises(kafka_admin_client):

test/test_consumer_group.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ def test_consumer(kafka_broker, topic):
3434
def test_consumer_topics(kafka_broker, topic):
3535
consumer = KafkaConsumer(bootstrap_servers=get_connect_str(kafka_broker))
3636
# Necessary to drive the IO
37-
consumer.poll(500)
37+
consumer.poll(5000)
3838
assert topic in consumer.topics()
3939
assert len(consumer.partitions_for_topic(topic)) > 0
4040
consumer.close()

tox.ini

+5-4
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
envlist = py312
33

44
[pytest]
5-
testpaths = test/test_ssl_integration.py
5+
#testpaths = test/test_ssl_integration.py
6+
testpaths = test
67
addopts = --durations=10
78
log_format = %(created)f %(filename)-23s %(threadName)s %(message)s
89

@@ -25,11 +26,11 @@ deps =
2526
crc32c
2627
botocore
2728
commands =
28-
pytest {posargs:--cov=kafka -vvv --tb=long --capture=sys --show-capture=all --log-level=notset --log-cli-level=notset --log-file-level=notset}
29+
pytest {posargs:--cov=kafka -vvv -x --junitxml=junit.xml --tb=long --capture=sys --show-capture=all --log-level=notset --log-cli-level=notset --log-file-level=notset}
2930
setenv =
3031
CRC32C_SW_MODE = auto
3132
PROJECT_ROOT = {toxinidir}
32-
RETRY_TIMEOUT_MULTIPLIER = 8
33-
MAX_TIMEOUT_MULTIPLIER = 8
33+
RETRY_TIMEOUT_MULTIPLIER = 1024
34+
MAX_TIMEOUT_MULTIPLIER = 1024
3435
passenv = KAFKA_VERSION
3536

0 commit comments

Comments
 (0)