Skip to content

Commit c40ca4f

Browse files
authored
chore: add more debug info regarding DDB Local ports (#1482)
1 parent a6651e4 commit c40ca4f

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

hll/dynamodb-mapper/dynamodb-mapper/build.gradle.kts

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -148,11 +148,21 @@ open class DynamoDbLocalInstance : DefaultTask() {
148148
.createServerFromCommandLineArgs(arrayOf("-inMemory", "-port", port.toString(), "-disableTelemetry"))
149149
.also { it.start() }
150150

151-
portFile.asFile.get().writeText(port.toString())
151+
portFile
152+
.asFile
153+
.get()
154+
.also { println("Writing port info file to ${it.absolutePath}") }
155+
.writeText(port.toString())
152156
}
153157

154158
fun stop() {
155-
runCatching { portFile.asFile.get().delete() }.onFailure { t -> println("Failed to delete $portFile: $t") }
159+
runCatching {
160+
portFile
161+
.asFile
162+
.get()
163+
.also { println("Deleting port info file at ${it.absolutePath}") }
164+
.delete()
165+
}.onFailure { t -> println("Failed to delete $portFile: $t") }
156166

157167
runner?.let {
158168
println("Stopping DynamoDB local instance on port $port")

hll/dynamodb-mapper/dynamodb-mapper/jvm/test/aws/sdk/kotlin/hll/dynamodbmapper/testutils/DdbLocalTest.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,9 @@ abstract class DdbLocalTest : AnnotationSpec() {
5050

5151
private val ddbHolder = lazy {
5252
val portFile = File("build/ddblocal/port.info").absoluteFile // Keep in sync with build.gradle.kts
53+
println("Reading DDB Local port info from ${portFile.absolutePath}")
5354
val port = portFile.readText().toInt()
55+
println("Connecting to DDB Local on port $port")
5456

5557
DynamoDbClient {
5658
endpointUrl = Url {

0 commit comments

Comments
 (0)