Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed flaky integration test #708

Merged
merged 1 commit into from
Mar 3, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,10 @@ public class ITDnsTest {

public static final String PREFIX = "gcldjvit-";
public static final Dns DNS = DnsOptions.builder().build().service();
public static final String PROJECT_ID = DNS.options().projectId();
public static final String ZONE_NAME1 = (PREFIX + UUID.randomUUID()).substring(0, 32);
public static final String ZONE_NAME_EMPTY_DESCRIPTION =
("gcldjvit-" + UUID.randomUUID()).substring(0, 32);
public static final String ZONE_NAME_TOO_LONG = (PREFIX + UUID.randomUUID());
(PREFIX + UUID.randomUUID()).substring(0, 32);
public static final String ZONE_NAME_TOO_LONG = PREFIX + UUID.randomUUID();
public static final String ZONE_DESCRIPTION1 = "first zone";
public static final String ZONE_DNS_NAME1 = ZONE_NAME1 + ".com.";
public static final String ZONE_DNS_EMPTY_DESCRIPTION = ZONE_NAME_EMPTY_DESCRIPTION + ".com.";
Expand Down Expand Up @@ -727,37 +726,43 @@ public void testGetChange() {
ChangeRequest created = zone.applyChangeRequest(CHANGE_ADD_ZONE1);
ChangeRequest retrieved = DNS.getChangeRequest(zone.name(), created.id());
assertEqChangesIgnoreStatus(created, retrieved);
waitUntilComplete(zone.name(), created.id());
zone.applyChangeRequest(CHANGE_DELETE_ZONE1);
// with options
created = zone.applyChangeRequest(CHANGE_ADD_ZONE1,
Dns.ChangeRequestOption.fields(Dns.ChangeRequestField.ID));
retrieved = DNS.getChangeRequest(zone.name(), created.id(),
Dns.ChangeRequestOption.fields(Dns.ChangeRequestField.ID));
assertEqChangesIgnoreStatus(created, retrieved);
waitUntilComplete(zone.name(), created.id());
zone.applyChangeRequest(CHANGE_DELETE_ZONE1);
created = zone.applyChangeRequest(CHANGE_ADD_ZONE1,
Dns.ChangeRequestOption.fields(Dns.ChangeRequestField.STATUS));
retrieved = DNS.getChangeRequest(zone.name(), created.id(),
Dns.ChangeRequestOption.fields(Dns.ChangeRequestField.STATUS));
assertEqChangesIgnoreStatus(created, retrieved);
waitUntilComplete(zone.name(), created.id());
zone.applyChangeRequest(CHANGE_DELETE_ZONE1);
created = zone.applyChangeRequest(CHANGE_ADD_ZONE1,
Dns.ChangeRequestOption.fields(Dns.ChangeRequestField.START_TIME));
retrieved = DNS.getChangeRequest(zone.name(), created.id(),
Dns.ChangeRequestOption.fields(Dns.ChangeRequestField.START_TIME));
assertEqChangesIgnoreStatus(created, retrieved);
waitUntilComplete(zone.name(), created.id());
zone.applyChangeRequest(CHANGE_DELETE_ZONE1);
created = zone.applyChangeRequest(CHANGE_ADD_ZONE1,
Dns.ChangeRequestOption.fields(Dns.ChangeRequestField.ADDITIONS));
retrieved = DNS.getChangeRequest(zone.name(), created.id(),
Dns.ChangeRequestOption.fields(Dns.ChangeRequestField.ADDITIONS));
assertEqChangesIgnoreStatus(created, retrieved);
waitUntilComplete(zone.name(), created.id());
// finishes with delete otherwise we cannot delete the zone
created = zone.applyChangeRequest(CHANGE_DELETE_ZONE1,
Dns.ChangeRequestOption.fields(Dns.ChangeRequestField.DELETIONS));
retrieved = DNS.getChangeRequest(zone.name(), created.id(),
Dns.ChangeRequestOption.fields(Dns.ChangeRequestField.DELETIONS));
assertEqChangesIgnoreStatus(created, retrieved);
waitUntilComplete(zone.name(), created.id());
} finally {
clear();
}
Expand Down