Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 95b1028

Browse files
author
Takashi Matsuo
authored
fix(run): add timestamp filter for faster test (GoogleCloudPlatform#4630)
fixes GoogleCloudPlatform#4609
1 parent 8c4eac6 commit 95b1028

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

run/logging-manual/e2e_test.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
# This test builds and deploys the two secure services
1717
# to test that they interact properly together.
1818

19+
import datetime
1920
import os
2021
import subprocess
2122
import time
@@ -117,7 +118,11 @@ def test_end_to_end(services):
117118
time.sleep(10) # Slight delay writing to stackdriver
118119
client = logging_v2.LoggingServiceV2Client()
119120
resource_names = [f"projects/{project}"]
121+
# We add timestamp for making the query faster.
122+
now = datetime.datetime.now(datetime.timezone.utc)
123+
filter_date = now - datetime.timedelta(minutes=1)
120124
filters = (
125+
f"timestamp>=\"{filter_date.isoformat('T')}\" "
121126
"resource.type=cloud_run_revision "
122127
"AND severity=NOTICE "
123128
f"AND resource.labels.service_name={service_name} "

0 commit comments

Comments
 (0)