Skip to content

Commit 87304dd

Browse files
---
yaml --- r: 8987 b: refs/heads/lesv-patch-1 c: f20eafc h: refs/heads/master i: 8985: 0c2a294 8983: 8042c85
1 parent 02f70b2 commit 87304dd

2 files changed

Lines changed: 11 additions & 9 deletions

File tree

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ refs/tags/v0.22.0: 18b298fe4bfe8ec2f20b0e0bf7ffdcce5cc3c5fe
6666
refs/heads/vam-google-patch-1: d0c8fee3a4074d0bf7360ce8c4f7f7223d0ee7b9
6767
refs/heads/vam-google-patch-CODEOWNERS: 2ac1616e25229e51d08a984708ef1918f91a35ee
6868
refs/heads/danoscarmike-patch-1: 7342a9916bce4ed00002c7202e2a16c5d46afaea
69-
refs/heads/lesv-patch-1: 9dc224c1848b3d2a5f824de767fb413b30310c91
69+
refs/heads/lesv-patch-1: f20eafcb41828e028369c1f894252961ce6f4796
7070
refs/heads/ml-update-branch: 079dd6610017f5c51b9d1938c12d6d55b61513cf
7171
refs/heads/vkedia-patch-2: 7d8241388a9769a5c069334761b06c7012c878e7
7272
refs/heads/vkedia-patch-3: 4d128043acaa7db9160faf439d2ca6104e8a88cb

branches/lesv-patch-1/google-cloud-logging/src/test/java/com/google/cloud/logging/BaseSystemTest.java

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,28 +22,22 @@
2222
import static org.junit.Assert.assertNull;
2323
import static org.junit.Assert.assertTrue;
2424

25-
import com.google.api.gax.paging.AsyncPage;
2625
import com.google.api.gax.paging.Page;
2726
import com.google.cloud.MonitoredResource;
2827
import com.google.cloud.MonitoredResourceDescriptor;
2928
import com.google.cloud.logging.Logging.EntryListOption;
3029
import com.google.cloud.logging.Logging.SortingField;
3130
import com.google.cloud.logging.Logging.SortingOrder;
32-
import com.google.cloud.logging.Logging.WriteOption;
3331
import com.google.cloud.logging.Payload.JsonPayload;
34-
import com.google.cloud.logging.Payload.ProtoPayload;
3532
import com.google.cloud.logging.Payload.StringPayload;
3633
import com.google.cloud.logging.SinkInfo.Destination.DatasetDestination;
3734
import com.google.common.collect.ImmutableList;
3835
import com.google.common.collect.ImmutableMap;
3936
import com.google.common.collect.Iterators;
4037
import com.google.common.collect.Sets;
4138
import com.google.logging.v2.LogName;
42-
import com.google.protobuf.Any;
43-
import com.google.protobuf.StringValue;
4439
import java.util.Iterator;
4540
import java.util.Set;
46-
import java.util.concurrent.ExecutionException;
4741
import java.util.logging.Level;
4842
import java.util.logging.Logger;
4943
import org.junit.Rule;
@@ -146,7 +140,7 @@ public void testListSinks() throws InterruptedException {
146140
@Test
147141
public void testListMonitoredResourceDescriptors() {
148142
Iterator<MonitoredResourceDescriptor> iterator =
149-
logging().listMonitoredResourceDescriptors(Logging.ListOption.pageSize(1)).iterateAll().iterator();
143+
logging().listMonitoredResourceDescriptors(Logging.ListOption.pageSize(100)).iterateAll().iterator();
150144
int count = 0;
151145
while (iterator.hasNext()) {
152146
assertNotNull(iterator.next().getType());
@@ -273,7 +267,15 @@ public void testWriteAndListLogEntries() throws InterruptedException {
273267
while (iterator.hasNext()) {
274268
assertTrue(iterator.next().getTimestamp() <= lastTimestamp);
275269
}
276-
assertTrue(logging().deleteLog(logId));
270+
int deleteAttempts = 0;
271+
int allowedDeleteAttempts = 5;
272+
boolean deleted = false;
273+
while (!deleted && deleteAttempts < allowedDeleteAttempts) {
274+
Thread.sleep(1000);
275+
deleted = logging().deleteLog(logId);
276+
deleteAttempts++;
277+
}
278+
assertTrue(deleted);
277279
}
278280

279281
@Test

0 commit comments

Comments
 (0)