@@ -1080,7 +1080,7 @@ aws_secret_access_key = ProfileSharedCredentialsSecretKey
10801080 t .Setenv (k , v )
10811081 }
10821082
1083- ctx , awsConfig , diags := GetAwsConfig (context . Background (), testCase .Config )
1083+ ctx , awsConfig , diags := GetAwsConfig (t . Context (), testCase .Config )
10841084
10851085 testCase .ValidateDiags (t , diags )
10861086 if diags .HasError () {
@@ -1120,7 +1120,7 @@ func testUserAgentProducts(t *testing.T, testCase test.UserAgentTestCase) {
11201120 httpSdkAgent = request .Header .Get ("X-Amz-User-Agent" )
11211121 })
11221122
1123- ctx , awsConfig , diags := GetAwsConfig (context . Background (), testCase .Config )
1123+ ctx , awsConfig , diags := GetAwsConfig (t . Context (), testCase .Config )
11241124 if diags .HasError () {
11251125 t .Fatalf ("error in GetAwsConfig(): %v" , diags )
11261126 }
@@ -1375,7 +1375,7 @@ region = us-west-2
13751375
13761376 testCase .Config .SkipCredsValidation = true
13771377
1378- _ , awsConfig , diags := GetAwsConfig (context . Background (), testCase .Config )
1378+ _ , awsConfig , diags := GetAwsConfig (t . Context (), testCase .Config )
13791379 if diags .HasError () {
13801380 t .Fatalf ("error in GetAwsConfig(): %v" , diags )
13811381 }
@@ -1490,7 +1490,7 @@ max_attempts = 10
14901490
14911491 testCase .Config .SkipCredsValidation = true
14921492
1493- _ , awsConfig , diags := GetAwsConfig (context . Background (), testCase .Config )
1493+ _ , awsConfig , diags := GetAwsConfig (t . Context (), testCase .Config )
14941494 if diags .HasError () {
14951495 t .Fatalf ("error in GetAwsConfig(): %v" , diags )
14961496 }
@@ -1621,7 +1621,7 @@ retry_mode = adaptive
16211621
16221622 testCase .Config .SkipCredsValidation = true
16231623
1624- _ , awsConfig , err := GetAwsConfig (context . Background (), testCase .Config )
1624+ _ , awsConfig , err := GetAwsConfig (t . Context (), testCase .Config )
16251625 if err != nil {
16261626 t .Fatalf ("error in GetAwsConfig() '%[1]T': %[1]s" , err )
16271627 }
@@ -1844,7 +1844,7 @@ use_fips_endpoint = true
18441844
18451845 testCase .Config .SkipCredsValidation = true
18461846
1847- ctx , awsConfig , diags := GetAwsConfig (context . Background (), testCase .Config )
1847+ ctx , awsConfig , diags := GetAwsConfig (t . Context (), testCase .Config )
18481848 if diags .HasError () {
18491849 t .Fatalf ("error in GetAwsConfig(): %v" , diags )
18501850 }
@@ -1973,7 +1973,7 @@ func TestEC2MetadataServiceClientEnableState(t *testing.T) {
19731973
19741974 testCase .Config .SkipCredsValidation = true
19751975
1976- _ , awsConfig , diags := GetAwsConfig (context . Background (), testCase .Config )
1976+ _ , awsConfig , diags := GetAwsConfig (t . Context (), testCase .Config )
19771977 if diags .HasError () {
19781978 t .Fatalf ("error in GetAwsConfig(): %v" , diags )
19791979 }
@@ -2158,7 +2158,7 @@ ec2_metadata_service_endpoint = https://127.1.1.1:1111
21582158
21592159 testCase .Config .SkipCredsValidation = true
21602160
2161- _ , awsConfig , diags := GetAwsConfig (context . Background (), testCase .Config )
2161+ _ , awsConfig , diags := GetAwsConfig (t . Context (), testCase .Config )
21622162
21632163 if diff := cmp .Diff (diags , testCase .ExpectedDiags ); diff != "" {
21642164 t .Errorf ("Unexpected response (+wanted, -got): %s" , diff )
@@ -2281,7 +2281,7 @@ ec2_metadata_service_endpoint_mode = IPv4
22812281
22822282 testCase .Config .SkipCredsValidation = true
22832283
2284- _ , awsConfig , diags := GetAwsConfig (context . Background (), testCase .Config )
2284+ _ , awsConfig , diags := GetAwsConfig (t . Context (), testCase .Config )
22852285 if diags .HasError () {
22862286 t .Fatalf ("error in GetAwsConfig(): %v" , diags )
22872287 }
@@ -2466,7 +2466,7 @@ ca_bundle = no-such-file
24662466
24672467 testCase .Config .SkipCredsValidation = true
24682468
2469- _ , awsConfig , diags := GetAwsConfig (context . Background (), testCase .Config )
2469+ _ , awsConfig , diags := GetAwsConfig (t . Context (), testCase .Config )
24702470 if diags .HasError () {
24712471 t .Fatalf ("error in GetAwsConfig(): %v" , diags )
24722472 }
@@ -2686,7 +2686,7 @@ aws_secret_access_key = SharedConfigurationSourceSecretKey
26862686
26872687 testCase .Config .SkipCredsValidation = true
26882688
2689- ctx , awsConfig , diags := GetAwsConfig (context . Background (), testCase .Config )
2689+ ctx , awsConfig , diags := GetAwsConfig (t . Context (), testCase .Config )
26902690
26912691 if diff := cmp .Diff (diags , testCase .ExpectedDiags ); diff != "" {
26922692 t .Errorf ("Unexpected response (+wanted, -got): %s" , diff )
@@ -2924,7 +2924,7 @@ web_identity_token_file = no-such-file
29242924
29252925 for testName , testCase := range testCases {
29262926 t .Run (testName , func (t * testing.T ) {
2927- ctx := context . Background ()
2927+ ctx := t . Context ()
29282928
29292929 servicemocks .InitSessionTestEnv (t )
29302930
@@ -3287,7 +3287,7 @@ endpoint_url = %[2]s
32873287 t .Run (name , func (t * testing.T ) {
32883288 servicemocks .InitSessionTestEnv (t )
32893289
3290- ctx := context . Background ()
3290+ ctx := t . Context ()
32913291
32923292 ts := servicemocks .MockAwsApiServer ("STS" , []* servicemocks.MockEndpoint {
32933293 servicemocks .MockStsGetCallerIdentityValidEndpoint ,
@@ -3528,7 +3528,7 @@ func TestGetAwsConfigWithAccountIDAndPartition(t *testing.T) {
35283528 defer ts .Close ()
35293529 testCase .config .StsEndpoint = ts .URL
35303530
3531- ctx , awsConfig , diags := GetAwsConfig (context . Background (), testCase .config )
3531+ ctx , awsConfig , diags := GetAwsConfig (t . Context (), testCase .config )
35323532 if diags .HasError () {
35333533 t .Fatalf ("error in GetAwsConfig(): %v" , diags )
35343534 }
@@ -3795,7 +3795,7 @@ func TestRetryHandlers(t *testing.T) {
37953795 SecretKey : servicemocks .MockStaticSecretKey ,
37963796 SkipCredsValidation : true ,
37973797 }
3798- ctx , awsConfig , diags := GetAwsConfig (context . Background (), config )
3798+ ctx , awsConfig , diags := GetAwsConfig (t . Context (), config )
37993799 if diags .HasError () {
38003800 t .Fatalf ("error in GetAwsConfig(): %v" , diags )
38013801 }
@@ -3860,7 +3860,7 @@ func (r *withNoDelay) RetryDelay(attempt int, err error) (time.Duration, error)
38603860}
38613861
38623862func TestLogger_TfLog (t * testing.T ) {
3863- ctx := context . Background ()
3863+ ctx := t . Context ()
38643864 var buf bytes.Buffer
38653865 ctx = tflogtest .RootLogger (ctx , & buf )
38663866
@@ -4029,7 +4029,7 @@ func TestLogger_TfLog(t *testing.T) {
40294029}
40304030
40314031func TestLoggerDefaultMasking_TfLog (t * testing.T ) {
4032- ctx := context . Background ()
4032+ ctx := t . Context ()
40334033 var buf bytes.Buffer
40344034 ctx = tflogtest .RootLogger (ctx , & buf )
40354035
@@ -4074,7 +4074,7 @@ func TestLoggerDefaultMasking_TfLog(t *testing.T) {
40744074}
40754075
40764076func TestLogger_HcLog (t * testing.T ) {
4077- ctx := context . Background ()
4077+ ctx := t . Context ()
40784078
40794079 rootName := "hc-log-test"
40804080 expectedName := rootName + "." + loggerName
0 commit comments