File tree Expand file tree Collapse file tree 1 file changed +9
-4
lines changed
appengine/standard/logging/test Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -41,17 +41,22 @@ public function testIndex()
41
41
$ response ->getBody ()->getContents ()
42
42
);
43
43
44
- $ this ->verifyLog ('This will show up as log level INFO ' , 'info ' );
44
+ $ this ->verifyLog ('This will show up as log level INFO ' , 'info ' , 3 );
45
+
46
+ // These should succeed if the above call has too.
47
+ // Thus, they need fewer retries!
45
48
$ this ->verifyLog ('This will show up as log level WARNING ' , 'warning ' );
46
49
$ this ->verifyLog ('This will show up as log level ERROR ' , 'error ' );
47
50
}
48
51
49
- private function verifyLog ($ message , $ level , $ retryCount = 5 )
52
+ private function verifyLog ($ message , $ level , $ retryCount = 2 )
50
53
{
54
+ $ fiveMinAgo = date (\DateTime::RFC3339 , strtotime ('-5 minutes ' ));
51
55
$ filter = sprintf (
52
- 'resource.type = "gae_app" AND severity = "%s" AND logName = "%s" ' ,
56
+ 'resource.type= "gae_app" severity= "%s" logName="%s" timestamp>= "%s" ' ,
53
57
strtoupper ($ level ),
54
- sprintf ('projects/%s/logs/app ' , self ::$ projectId )
58
+ sprintf ('projects/%s/logs/app ' , self ::$ projectId ),
59
+ $ fiveMinAgo
55
60
);
56
61
$ logOptions = [
57
62
'pageSize ' => 20 ,
You can’t perform that action at this time.
0 commit comments