Skip to content

Commit

Permalink
Ensure all servers are up for later tests, even if test_3x5_reconnect…
Browse files Browse the repository at this point in the history
…s fails.
  • Loading branch information
David Ormsbee committed Jan 5, 2012
1 parent 06f6778 commit abaec3c
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion brod/test/test_zk.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,9 @@ def __init__(self, kafka_config):
self.process = None

def start(self):
if self.process:
return

env = os.environ.copy()
env["JMX_PORT"] = str(self.kafka_config.jmx_port)
log.info("SETUP: Starting Kafka with config {0}".format(self.kafka_config))
Expand Down Expand Up @@ -400,7 +403,10 @@ def test_3x5_zookeeper_invalid_offset():
assert result
for msg_set in result:
assert_equals(msg_set.messages, ["world"])


# Make sure that even if the test fails, the instance we brought down starts
# back up.
@with_setup(teardown=lambda: RunConfig.kafka_servers[0].start())
def test_3x5_reconnects():
"""Test that we keep trying to read, even if our brokers go down.
Expand Down Expand Up @@ -469,6 +475,8 @@ def test_3x5_reconnects():
assert_equal(topology_3x5.partitions_per_broker,
len([msg_set for msg_set in result
if msg_set.messages == ["Jack"]]))





Expand Down

0 comments on commit abaec3c

Please sign in to comment.