@@ -40,9 +40,13 @@ void main() async {
4040
4141 final requestMetadata = BucketMetadata (name: bucketName);
4242
43- final beforeRequestTime = DateTime .now ().toUtc ();
43+ final beforeRequestTime = DateTime .now ().toUtc ().subtract (
44+ const Duration (seconds: 1 ), // Add some buffer for clock skew.
45+ );
4446 final actualMetadata = await storage.createBucket (requestMetadata);
45- final afterRequestTime = DateTime .now ().toUtc ();
47+ final afterRequestTime = DateTime .now ().toUtc ().add (
48+ const Duration (seconds: 1 ), // Add some buffer for clock skew.
49+ );
4650
4751 expect (actualMetadata.acl, isNull);
4852 expect (actualMetadata.autoclass, isNull);
@@ -134,9 +138,13 @@ void main() async {
134138 ),
135139 );
136140
137- final beforeRequestTime = DateTime .now ().toUtc ();
141+ final beforeRequestTime = DateTime .now ().toUtc ().subtract (
142+ const Duration (seconds: 1 ), // Add some buffer for clock skew.
143+ );
138144 final actualMetadata = await storage.createBucket (requestMetadata);
139- final afterRequestTime = DateTime .now ().toUtc ();
145+ final afterRequestTime = DateTime .now ().toUtc ().add (
146+ const Duration (seconds: 1 ), // Add some buffer for clock skew.
147+ );
140148
141149 expect (actualMetadata.autoclass! .enabled, true );
142150 expect (actualMetadata.autoclass! .terminalStorageClass, 'NEARLINE' );
0 commit comments