Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump Misk and Kotlin 2 #419

Merged
merged 3 commits into from
Feb 21, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
GROUP=app.cash.backfila

org.gradle.jvmargs='-Dfile.encoding=UTF-8'
org.gradle.jvmargs=-Xmx6g -XX:MaxMetaspaceSize=5g -Dfile.encoding=UTF-8
11 changes: 6 additions & 5 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
[versions]
jooq = "3.18.25"
kotlin = "1.9.23"
kotlin = "2.0.21"
kotlinxCoroutines = "1.10.1"
ktlint = "0.47.1"
misk = "2025.01.09.184726-680bca2"
misk = "2025.02.11.123913-8a41324"
okhttp = "5.0.0-alpha.14"
sqldelight = "2.0.2"
wire = "5.2.1"
Expand Down Expand Up @@ -63,9 +64,9 @@ kotlinPoet = { module = "com.squareup:kotlinpoet", version = "1.18.1" }
kotlinReflection = { module = "org.jetbrains.kotlin:kotlin-reflect", version.ref = "kotlin" }
kotlinStdLib = { module = "org.jetbrains.kotlin:kotlin-stdlib", version.ref = "kotlin" }
kotlinTest = { module = "org.jetbrains.kotlin:kotlin-test", version.ref = "kotlin" }
kotlinxCoroutines = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-core", version = "1.6.3" }
kotlinxCoroutinesLogging = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-slf4j", version = "1.6.3" }
kotlinxCoroutinesTest = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-test", version = "1.6.3" }
kotlinxCoroutines = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-core", version.ref = "kotlinxCoroutines" }
kotlinxCoroutinesLogging = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-slf4j", version.ref = "kotlinxCoroutines" }
kotlinxCoroutinesTest = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-test", version.ref = "kotlinxCoroutines" }
kotlinxHtml = { module = "org.jetbrains.kotlinx:kotlinx-html-jvm", version = "0.12.0" }
misk = { module = "com.squareup.misk:misk", version.ref = "misk" }
miskActions = { module = "com.squareup.misk:misk-actions", version.ref = "misk" }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ import java.util.concurrent.TimeUnit
import javax.inject.Inject
import kotlinx.coroutines.delay
import kotlinx.coroutines.launch
import kotlinx.coroutines.test.runTest
import misk.hibernate.Transacter
import misk.hibernate.load
import misk.scope.ActionScope
Expand Down Expand Up @@ -84,7 +85,7 @@ class BackfillRunnerTest {
assertThat(partition.run_state).isEqualTo(BackfillState.RUNNING)
}

runBlockingTestCancellable {
runTest {
runner.start(this)
}

Expand All @@ -111,7 +112,7 @@ class BackfillRunnerTest {
assertThat(partition.pkey_cursor).isNull()
assertThat(partition.state).isEqualTo(BackfillState.RUNNING)

runBlockingTestCancellable {
runTest {
runner.start(this)
}

Expand Down Expand Up @@ -147,7 +148,7 @@ class BackfillRunnerTest {
fakeBackfilaClientServiceClient.dontBlockGetNextBatch()
val runner = startBackfill(numThreads = 1)

runBlockingTestCancellable {
runTest {
runner.start(this)

// We should only get numthreads=1 calls in parallel, then it must wait for more room.
Expand All @@ -170,7 +171,7 @@ class BackfillRunnerTest {
fakeBackfilaClientServiceClient.dontBlockGetNextBatch()
val runner = startBackfill(numThreads = 1)

runBlockingTestCancellable {
runTest {
runner.start(this)
val firstRequest = fakeBackfilaClientServiceClient.runBatchRequests.receive()
assertThat(firstRequest.parameters).containsEntry("cheese", "cheddar".encodeUtf8())
Expand All @@ -188,7 +189,7 @@ class BackfillRunnerTest {
)
}

runBlockingTestCancellable {
runTest {
runner.start(this)

val firstRequest = fakeBackfilaClientServiceClient.runBatchRequests.receive()
Expand All @@ -201,7 +202,7 @@ class BackfillRunnerTest {
fakeBackfilaClientServiceClient.dontBlockGetNextBatch()
val runner = startBackfill(numThreads = 3)

runBlockingTestCancellable {
runTest {
runner.start(this)

// We should only get numthreads=3 calls in parallel, then it must wait for more room.
Expand Down Expand Up @@ -256,7 +257,7 @@ class BackfillRunnerTest {
partition.precomputing_done = true
}

runBlockingTestCancellable {
runTest {
runner.start(this)

assertThat(fakeBackfilaClientServiceClient.getNextBatchRangeRequests.receive()).isNotNull()
Expand Down Expand Up @@ -296,7 +297,7 @@ class BackfillRunnerTest {
partition.precomputing_done = true
}

runBlockingTestCancellable {
runTest {
launch { runner.start(this) }

// Process 4 getNextBatchRangeRequests
Expand Down Expand Up @@ -376,7 +377,7 @@ class BackfillRunnerTest {
fakeBackfilaClientServiceClient.dontBlockGetNextBatch()
val runner = startBackfill(numThreads = 1)

runBlockingTestCancellable {
runTest {
launch { runner.start(this) }
// Leave awaiting run batch response
fakeBackfilaClientServiceClient.runBatchRequests.receive()
Expand Down Expand Up @@ -407,7 +408,7 @@ class BackfillRunnerTest {
fakeBackfilaClientServiceClient.dontBlockGetNextBatch()
val runner = startBackfill(numThreads = 2)

runBlockingTestCancellable {
runTest {
launch { runner.start(this) }

val firstRequest = fakeBackfilaClientServiceClient.runBatchRequests.receive()
Expand Down Expand Up @@ -451,7 +452,7 @@ class BackfillRunnerTest {
fakeBackfilaClientServiceClient.dontBlockGetNextBatch()
val runner = startBackfill(numThreads = 1)

runBlockingTestCancellable {
runTest {
launch { runner.start(this) }

val firstRequest = fakeBackfilaClientServiceClient.runBatchRequests.receive()
Expand Down Expand Up @@ -492,7 +493,7 @@ class BackfillRunnerTest {
fakeBackfilaClientServiceClient.dontBlockGetNextBatch()
val runner = startBackfill(numThreads = 2)

runBlockingTestCancellable {
runTest {
launch { runner.start(this) }

val firstRequest = fakeBackfilaClientServiceClient.runBatchRequests.receive()
Expand Down Expand Up @@ -550,7 +551,7 @@ class BackfillRunnerTest {
partition.precomputing_done = true
}

runBlockingTestCancellable {
runTest {
launch { runner.start(this) }

assertThat(fakeBackfilaClientServiceClient.getNextBatchRangeRequests.receive()).isNotNull()
Expand All @@ -576,7 +577,7 @@ class BackfillRunnerTest {
fakeBackfilaClientServiceClient.dontBlockGetNextBatch()
val runner = startBackfill(numThreads = 1)

runBlockingTestCancellable {
runTest {
launch { runner.start(this) }

fakeBackfilaClientServiceClient.runBatchRequests.receive()
Expand All @@ -591,7 +592,7 @@ class BackfillRunnerTest {
// Nothing sent yet - the backoff is 1000ms
assertThat(fakeBackfilaClientServiceClient.runBatchRequests.tryReceive().getOrNull()).isNull()
delay(500)
assertThat(fakeBackfilaClientServiceClient.runBatchRequests.tryReceive().getOrNull()).isNotNull()
assertThat(fakeBackfilaClientServiceClient.runBatchRequests.receive()).isNotNull()
fakeBackfilaClientServiceClient.runBatchResponses.send(
Result.success(RunBatchResponse.Builder().build()),
)
Expand All @@ -609,7 +610,7 @@ class BackfillRunnerTest {
fakeBackfilaClientServiceClient.dontBlockGetNextBatch()
val runner = startBackfill(numThreads = 1, extraSleepMs = 1000L)

runBlockingTestCancellable {
runTest {
launch { runner.start(this) }

fakeBackfilaClientServiceClient.runBatchRequests.receive()
Expand All @@ -621,7 +622,7 @@ class BackfillRunnerTest {
// Nothing sent yet - the backoff is 1000ms
assertThat(fakeBackfilaClientServiceClient.runBatchRequests.tryReceive().getOrNull()).isNull()
delay(500)
assertThat(fakeBackfilaClientServiceClient.runBatchRequests.tryReceive().getOrNull()).isNotNull()
assertThat(fakeBackfilaClientServiceClient.runBatchRequests.receive()).isNotNull()
fakeBackfilaClientServiceClient.runBatchResponses.send(
Result.success(RunBatchResponse.Builder().build()),
)
Expand All @@ -639,7 +640,7 @@ class BackfillRunnerTest {
fakeBackfilaClientServiceClient.dontBlockGetNextBatch()
val runner = startBackfill(numThreads = 2, extraSleepMs = 1000L)

runBlockingTestCancellable {
runTest {
launch { runner.start(this) }

fakeBackfilaClientServiceClient.runBatchRequests.receive()
Expand All @@ -655,7 +656,7 @@ class BackfillRunnerTest {
// Nothing sent yet - the backoff is 1000ms
assertThat(fakeBackfilaClientServiceClient.runBatchRequests.tryReceive().getOrNull()).isNull()
delay(500)
assertThat(fakeBackfilaClientServiceClient.runBatchRequests.tryReceive().getOrNull()).isNotNull()
assertThat(fakeBackfilaClientServiceClient.runBatchRequests.receive()).isNotNull()
fakeBackfilaClientServiceClient.runBatchResponses.send(
Result.success(RunBatchResponse.Builder().build()),
)
Expand All @@ -678,7 +679,7 @@ class BackfillRunnerTest {
partition.precomputing_done = true
}

runBlockingTestCancellable {
runTest {
launch { runner.start(this) }

assertThat(fakeBackfilaClientServiceClient.getNextBatchRangeRequests.receive()).isNotNull()
Expand All @@ -697,9 +698,9 @@ class BackfillRunnerTest {
// The first batch has no matching records, so no delay is added.
// The second batch, with nonzero matching count, gets run immediately.
val runBatchRequest =
fakeBackfilaClientServiceClient.runBatchRequests.tryReceive().getOrNull()
fakeBackfilaClientServiceClient.runBatchRequests.receive()
assertThat(runBatchRequest).isNotNull()
assertThat(runBatchRequest!!.batch_range).isEqualTo(
assertThat(runBatchRequest.batch_range).isEqualTo(
KeyRange("100".encodeUtf8(), "199".encodeUtf8()),
)
runner.stop()
Expand All @@ -710,13 +711,13 @@ class BackfillRunnerTest {
fakeBackfilaClientServiceClient.dontBlockGetNextBatch()
val runner = startBackfill(numThreads = 3)

runBlockingTestCancellable {
runTest {
launch { runner.start(this) }

// We should only get numthreads=3 calls in parallel, then it must wait for more room.
assertThat(fakeBackfilaClientServiceClient.runBatchRequests.tryReceive().getOrNull()).isNotNull()
assertThat(fakeBackfilaClientServiceClient.runBatchRequests.tryReceive().getOrNull()).isNotNull()
assertThat(fakeBackfilaClientServiceClient.runBatchRequests.tryReceive().getOrNull()).isNotNull()
assertThat(fakeBackfilaClientServiceClient.runBatchRequests.receive()).isNotNull()
assertThat(fakeBackfilaClientServiceClient.runBatchRequests.receive()).isNotNull()
assertThat(fakeBackfilaClientServiceClient.runBatchRequests.receive()).isNotNull()
assertThat(fakeBackfilaClientServiceClient.runBatchRequests.tryReceive().getOrNull()).isNull()

scope.fakeCaller(user = "molly") {
Expand All @@ -735,9 +736,9 @@ class BackfillRunnerTest {
fakeBackfilaClientServiceClient.runBatchResponses.send(
Result.success(RunBatchResponse.Builder().build()),
)
assertThat(fakeBackfilaClientServiceClient.runBatchRequests.tryReceive().getOrNull()).isNotNull()
assertThat(fakeBackfilaClientServiceClient.runBatchRequests.tryReceive().getOrNull()).isNotNull()
assertThat(fakeBackfilaClientServiceClient.runBatchRequests.tryReceive().getOrNull()).isNotNull()
assertThat(fakeBackfilaClientServiceClient.runBatchRequests.receive()).isNotNull()
assertThat(fakeBackfilaClientServiceClient.runBatchRequests.receive()).isNotNull()
assertThat(fakeBackfilaClientServiceClient.runBatchRequests.receive()).isNotNull()
assertThat(fakeBackfilaClientServiceClient.runBatchRequests.tryReceive().getOrNull()).isNull()
runner.stop()
}
Expand All @@ -753,7 +754,7 @@ class BackfillRunnerTest {
fakeBackfilaClientServiceClient.dontBlockGetNextBatch()
val runner = startBackfill(numThreads = 1)

runBlockingTestCancellable {
runTest {
launch { runner.start(this) }

val initialRequest = fakeBackfilaClientServiceClient.runBatchRequests.receive()
Expand Down Expand Up @@ -834,7 +835,7 @@ class BackfillRunnerTest {
fakeBackfilaClientServiceClient.dontBlockGetNextBatch()
val runner = startBackfill(numThreads = 3)

runBlockingTestCancellable {
runTest {
launch { runner.start(this) }

// We should only get numthreads=3 calls in parallel, then it must wait for more room.
Expand Down

This file was deleted.

Loading