7029fcc6ff92856d43119a56b9d3367ae0fd7b55,container_registry/container_analysis/samples_test.py,TestContainerAnalysisSamples,test_pubsub,#TestContainerAnalysisSamples#,130
Before Change
subscription_id)
samples.create_occurrence_subscription(subscription_id, PROJECT_ID)
tries = 0
success = False
while not success and tries < TRY_LIMIT:
print(tries)
tries += 1
receiver = samples.MessageReceiver()
client.subscribe(subscription_name, receiver.pubsub_callback)
// test adding 3 more occurrences
total_created = 3
for _ in range(total_created):
occ = samples.create_occurrence(self.image_url,
self.note_id,
PROJECT_ID,
PROJECT_ID)
sleep(SLEEP_TIME)
samples.delete_occurrence(basename(occ.name), PROJECT_ID)
sleep(SLEEP_TIME)
print("done. msg_count = {}".format(receiver.msg_count))
success = receiver.msg_count == total_created
assert receiver.msg_count == total_created
// clean up
client.delete_subscription(subscription_name)
After Change
// the server started to dedup?
message_count = 1
try:
job_done = threading.Event()
receiver = MessageReceiver(message_count, job_done)
client.subscribe(subscription_name, receiver.pubsub_callback)
for i in range(message_count):
occ = samples.create_occurrence(
self.image_url, self.note_id, PROJECT_ID, PROJECT_ID)
time.sleep(SLEEP_TIME)
samples.delete_occurrence(basename(occ.name), PROJECT_ID)
time.sleep(SLEEP_TIME)
job_done.wait(timeout=60)
print("done. msg_count = {}".format(receiver.msg_count))
assert message_count <= receiver.msg_count
finally:
// clean up
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 5
Instances
Project Name: GoogleCloudPlatform/python-docs-samples
Commit Name: 7029fcc6ff92856d43119a56b9d3367ae0fd7b55
Time: 2020-04-21
Author: tmatsuo@google.com
File Name: container_registry/container_analysis/samples_test.py
Class Name: TestContainerAnalysisSamples
Method Name: test_pubsub
Project Name: mozilla/bugbug
Commit Name: 6a0bf7022eea89f8382d8260f27cf7fde986475b
Time: 2020-04-29
Author: mcastelluccio@mozilla.com
File Name: http_service/tests/test_readthrough_cache.py
Class Name:
Method Name: test_cache_thread
Project Name: GoogleCloudPlatform/python-docs-samples
Commit Name: e2cf90d31834efe15f025902ec1e7843d5c2ac54
Time: 2020-04-20
Author: tmatsuo@google.com
File Name: iot/api-client/mqtt_example/cloudiot_mqtt_image.py
Class Name:
Method Name: receive_image