Skip to content

Instantly share code, notes, and snippets.

@schmir
Created December 20, 2012 09:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save schmir/4344132 to your computer and use it in GitHub Desktop.
Save schmir/4344132 to your computer and use it in GitHub Desktop.
#! /usr/bin/env python
"""reproduce https://github.com/majek/puka/issues/34
starting 2 instances of this program reproduces the error in less than
20s on my machine
"""
import puka, os
def doit(name):
client = puka.Client()
promise = client.connect()
client.wait(promise)
promise = client.queue_declare(queue=name)
client.wait(promise)
promise = client.basic_publish(exchange='', routing_key=name,
body="xxxxxx")
client.wait(promise)
consume_promise = client.basic_consume(queue=name)
# msg_result = client.wait(consume_promise)
promise = client.queue_delete(name)
# client.wait(promise)
promise = client.close()
client.wait(promise)
i = 0
while 1:
name = "foobar-%s=%s" % (os.getpid(), i)
doit(name)
i += 1
print i
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment