File tree Expand file tree Collapse file tree 3 files changed +11
-3
lines changed
Google.Cloud.Spanner.Data
Google.Cloud.Spanner.Data.CommonTesting
Google.Cloud.Spanner.Data.IntegrationTests
Google.Cloud.Spanner.V1/Google.Cloud.Spanner.V1 Expand file tree Collapse file tree 3 files changed +11
-3
lines changed Original file line number Diff line number Diff line change 1- // Copyright 2018 Google LLC
1+ // Copyright 2018 Google LLC
22//
33// Licensed under the Apache License, Version 2.0 (the "License");
44// you may not use this file except in compliance with the License.
@@ -29,11 +29,13 @@ public abstract class SpannerTableFixture : SpannerFixtureBase
2929 public SpannerTableFixture ( string tableName )
3030 {
3131 TableName = tableName ;
32+
3233 if ( Database . Fresh )
3334 {
3435 Logger . DefaultLogger . Debug ( $ "Creating table { TableName } ") ;
3536 CreateTable ( ) ;
3637 }
38+
3739 RetryHelpers . ResetStats ( ) ;
3840 Logger . DefaultLogger . Debug ( $ "Populating table { TableName } ") ;
3941 PopulateTable ( Database . Fresh ) ;
Original file line number Diff line number Diff line change 1212// See the License for the specific language governing permissions and
1313// limitations under the License.
1414
15+ using Google . Cloud . Spanner . Data . CommonTesting ;
1516using System ;
1617using System . Collections . Generic ;
1718using System . Linq ;
@@ -30,6 +31,7 @@ public PartitionedReadTests(PartitionedReadTableFixture fixture) =>
3031 _fixture = fixture ;
3132
3233 [ SkippableTheory , CombinatorialData ]
34+ [ Trait ( Constants . SupportedOnEmulator , Constants . No ) ]
3335 public async Task DistributedReadAsync ( bool dataBoostEnabled )
3436 {
3537 // TODO: xUnit 3 will allow to set traits to individual data rows, and we should use that instead for consistency.
@@ -53,6 +55,7 @@ public async Task DistributedReadAsync(bool dataBoostEnabled)
5355 }
5456
5557 [ SkippableTheory , CombinatorialData ]
58+ [ Trait ( Constants . SupportedOnEmulator , Constants . No ) ]
5659 public async Task DistributedQueryAsync ( bool dataBoostEnabled )
5760 {
5861 // TODO: xUnit 3 will allow to set traits to individual data rows, and we should use that instead for consistency.
Original file line number Diff line number Diff line change @@ -154,12 +154,15 @@ internal bool SessionHasExpired(double intervalInDays = SoftRefreshIntervalInDay
154154 {
155155 DateTime currentTime = _clock . GetCurrentDateTimeUtc ( ) ;
156156 DateTime ? sessionCreateTime = _session ? . CreateTime . ToDateTime ( ) ; // Inherent conversion into UTC DateTime
157- if ( _session == null || _session . Expired || currentTime - sessionCreateTime >= TimeSpan . FromDays ( intervalInDays ) )
157+ if ( _session == null
158+ || _session . Expired
159+ || ! string . IsNullOrEmpty ( Environment . GetEnvironmentVariable ( "SPANNER_EMULATOR_HOST" ) )
160+ || currentTime - sessionCreateTime >= TimeSpan . FromDays ( intervalInDays ) )
158161 {
159162 return true ;
160163 }
161164
162- return false ;
165+ return true ;
163166 }
164167
165168 private async Task CreateOrRefreshSessionsAsync ( CancellationToken cancellationToken )
You can’t perform that action at this time.
0 commit comments