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

Purge Products #1569

Merged
merged 13 commits into from
Sep 6, 2019
Prev Previous commit
Next Next commit
removed TODOs comments, added UUID for tests
munkhuushmgl committed Aug 30, 2019

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
commit 28ed6be4be3f33be59e857d780025f6b7707a519
Original file line number Diff line number Diff line change
@@ -176,11 +176,8 @@ public static void purgeProductsInProductSet(
.setForce(force)
.build();

//TODO: once its supported in all regions, will change it to 60 sec.
// testing method with region asia-east1 seems bit slower than normal.

OperationFuture<Empty, BatchOperationMetadata> response = client.purgeProductsAsync(req);
response.getPollingFuture().get(90, TimeUnit.MINUTES);
response.getPollingFuture().get(90, TimeUnit.SECONDS);

System.out.println("Products removed from product set.");
}
Original file line number Diff line number Diff line change
@@ -241,9 +241,6 @@ public static void purgeOrphanProducts(String projectId, String computeRegion, b
.build();

OperationFuture response = client.purgeProductsAsync(req);

//TODO: once its supported in all regions, will change it to 60 sec.
// testing method with region asia-east1 seems bit slower than normal.
response.getPollingFuture().get(90, TimeUnit.SECONDS);

System.out.println("Orphan products deleted.");
Original file line number Diff line number Diff line change
@@ -21,6 +21,8 @@
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.PrintStream;
import java.util.UUID;

import org.junit.After;
import org.junit.Before;
import org.junit.Test;
@@ -35,7 +37,7 @@ public class ProductInProductSetManagementIT {
private static final String COMPUTE_REGION = "us-west1";
private static final String PRODUCT_SET_DISPLAY_NAME =
"fake_pdt_set_display_name_for_testing";
private static final String PRODUCT_SET_ID = "fake_pdt_set_id_for_testing";
private static final String PRODUCT_SET_ID = "fake_pdt_set_id_for_testing" + UUID.randomUUID();
private static final String PRODUCT_DISPLAY_NAME = "fake_pdt_display_name_for_testing";
private static final String PRODUCT_CATEGORY = "apparel";
private static final String PRODUCT_ID = "fake_pdt_id_for_testing";