Skip to content

Commit 958bb6f

Browse files
authored
chore: remove flakey test and make build more cache friendly (#606)
1 parent 842d38a commit 958bb6f

File tree

4 files changed

+3
-31
lines changed

4 files changed

+3
-31
lines changed

aws-runtime/aws-config/build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ kotlin {
7171
}
7272

7373
fun awsModelFile(name: String): String =
74-
rootProject.file("codegen/sdk/aws-models/$name").absolutePath
74+
rootProject.file("codegen/sdk/aws-models/$name").relativeTo(project.buildDir).toString()
7575

7676
codegen {
7777
val basePackage = "aws.sdk.kotlin.runtime.auth.credentials.internal"

aws-runtime/aws-config/common/test/aws/sdk/kotlin/runtime/config/imds/ImdsClientTest.kt

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,10 @@ import aws.smithy.kotlin.runtime.http.HttpStatusCode
1212
import aws.smithy.kotlin.runtime.http.endpoints.Endpoint
1313
import aws.smithy.kotlin.runtime.http.response.HttpResponse
1414
import aws.smithy.kotlin.runtime.httptest.buildTestConnection
15-
import aws.smithy.kotlin.runtime.testing.IgnoreWindows
16-
import aws.smithy.kotlin.runtime.time.Instant
1715
import aws.smithy.kotlin.runtime.time.ManualClock
18-
import aws.smithy.kotlin.runtime.time.epochMilliseconds
1916
import io.kotest.matchers.string.shouldContain
2017
import kotlinx.coroutines.ExperimentalCoroutinesApi
21-
import kotlinx.coroutines.runBlocking
2218
import kotlinx.coroutines.test.runTest
23-
import kotlinx.coroutines.withTimeout
2419
import kotlinx.serialization.json.*
2520
import kotlin.test.*
2621
import kotlin.time.Duration.Companion.seconds
@@ -212,29 +207,6 @@ class ImdsClientTest {
212207
connection.assertRequests()
213208
}
214209

215-
@IgnoreWindows("DNS fails faster on windows and results in a different error: `socket connect failure, no route to host`")
216-
@Test
217-
fun testHttpConnectTimeouts() = runBlocking {
218-
// end-to-end real client times out after 1-second
219-
val client = ImdsClient {
220-
// will never resolve
221-
endpointConfiguration = EndpointConfiguration.Custom("http://240.0.0.0".toEndpoint())
222-
}
223-
224-
val start = Instant.now()
225-
val ex = assertFails {
226-
withTimeout(3000) {
227-
client.get("/latest/metadata")
228-
}
229-
}
230-
231-
// this message is asserted against whatever the default HTTP client engine throws for an exception...
232-
assertTrue(ex.message!!.lowercase().contains("timeout has expired"), "message `${ex.message}`")
233-
val elapsed = Instant.now().epochMilliseconds - start.epochMilliseconds
234-
assertTrue(elapsed >= 1000, "expected elapsed ms to be greater than 1000; actual = $elapsed")
235-
assertTrue(elapsed < 2000, "expected elapsed ms to be less than 2000; actual = $elapsed")
236-
}
237-
238210
data class ImdsConfigTest(
239211
val name: String,
240212
val env: Map<String, String>,

gradle/publish.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ tasks.register("javadocJar", Jar) {
1414

1515
publishing {
1616
repositories {
17-
maven { name = "testLocal"; url = "$rootProject.buildDir/m2" }
17+
maven { name = "localBuildDir"; url = "$rootProject.buildDir/m2" }
1818
maven {
1919
name = "awsCodeArtifact"
2020
url = project.findProperty("codeartifact.url")

tests/codegen/event-stream/build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ codegen {
4747
tests.forEach { test ->
4848

4949
projections.register(test.projectionName) {
50-
imports = listOf(test.model.absolutePath)
50+
imports = listOf(test.model.relativeTo(project.buildDir).toString())
5151
transforms = listOf(
5252
"""
5353
{

0 commit comments

Comments
 (0)