2
0
mirror of https://github.com/VinylDNS/vinyldns synced 2025-09-04 00:05:12 +00:00

move zone change processing into zone sync handler (#398)

* move zone change processing into zone sync handler
This commit is contained in:
Britney Wright
2018-12-20 12:20:16 -05:00
committed by GitHub
parent 48c7f9fb0b
commit 03b37366a5
5 changed files with 257 additions and 147 deletions

View File

@@ -87,17 +87,6 @@ records_post_update = [
'records': [{u'address': u'6.7.8.9'}]}]
def wait_for_zone_sync_to_complete(client, zone_id, latest_sync):
retries = MAX_RETRIES
zone_request = client.get_zone(zone_id)
while zone_request[u'zone'][u'latestSync'] == latest_sync and retries > 0:
zone_request = client.get_zone(zone_id)
time.sleep(RETRY_WAIT)
retries -= 1
assert_that(zone_request[u'zone'][u'latestSync'], is_not(latest_sync))
@pytest.mark.skip_production
def test_sync_zone_success(shared_zone_test_context):
"""
@@ -163,8 +152,8 @@ def test_sync_zone_success(shared_zone_test_context):
time.sleep(10)
# sync again
client.sync_zone(zone['id'], status=202)
wait_for_zone_sync_to_complete(client, zone['id'], latest_sync)
change = client.sync_zone(zone['id'], status=202)
client.wait_until_zone_change_status_synced(change)
# confirm cannot again sync without waiting
client.sync_zone(zone['id'], status=403)