Skip to content

Commit bff3dfb

Browse files
committed
Removing non-determinstic test
1 parent 24f8a86 commit bff3dfb

File tree

1 file changed

+1
-31
lines changed
  • test/codegen-generated-classes-test/src/test/java/software/amazon/awssdk/services

1 file changed

+1
-31
lines changed

test/codegen-generated-classes-test/src/test/java/software/amazon/awssdk/services/TraceIdTest.java

Lines changed: 1 addition & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
import java.util.concurrent.ExecutionException;
2323
import java.util.concurrent.ExecutorService;
2424
import java.util.concurrent.Executors;
25+
import org.junit.jupiter.api.RepeatedTest;
2526
import org.junit.jupiter.api.Test;
2627
import software.amazon.awssdk.auth.credentials.AnonymousCredentialsProvider;
2728
import software.amazon.awssdk.awscore.interceptor.TraceIdExecutionInterceptor;
@@ -311,35 +312,4 @@ public void traceIdInterceptorWithExecutiveServicePreservesTraceId() {
311312
}
312313
});
313314
}
314-
315-
@Test
316-
public void traceIdInterceptorWithRunAsyncDoesNotPreservesTraceId() throws Exception {
317-
EnvironmentVariableHelper.run(env -> {
318-
env.set("AWS_LAMBDA_FUNCTION_NAME", "foo");
319-
320-
SdkInternalThreadLocal.put("AWS_LAMBDA_X_TRACE_ID", "SdkInternalThreadLocal-trace-123");
321-
try (MockSyncHttpClient mockHttpClient = new MockSyncHttpClient();
322-
ProtocolRestJsonClient client = ProtocolRestJsonClient.builder()
323-
.region(Region.US_WEST_2)
324-
.credentialsProvider(AnonymousCredentialsProvider.create())
325-
.httpClient(mockHttpClient)
326-
.build()) {
327-
328-
mockHttpClient.stubNextResponse(HttpExecuteResponse.builder()
329-
.response(SdkHttpResponse.builder().statusCode(200).build())
330-
.responseBody(AbortableInputStream.create(new StringInputStream("{}")))
331-
.build());
332-
333-
CompletableFuture.runAsync(client::allTypes).get();
334-
335-
List<SdkHttpRequest> requests = mockHttpClient.getRequests();
336-
assertThat(requests.get(0).firstMatchingHeader("X-Amzn-Trace-Id")).isEmpty();
337-
338-
} catch (InterruptedException | ExecutionException e) {
339-
throw new RuntimeException(e);
340-
} finally {
341-
SdkInternalThreadLocal.clear();
342-
}
343-
});
344-
}
345315
}

0 commit comments

Comments
 (0)