This is an automated email from the ASF dual-hosted git repository.
Philippus pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/pekko-management.git
The following commit(s) were added to refs/heads/main by this push:
new bf24d863 Clean up k8s lease-related test files (#928)
bf24d863 is described below
commit bf24d86319bc80baa91d23a079c3bc41da961fb2
Author: Philippus Baalman <[email protected]>
AuthorDate: Sat Aug 8 22:51:45 2026 +0200
Clean up k8s lease-related test files (#928)
* Move files to correct package
* Fix test descriptions
* Update
lease-kubernetes/src/test/scala/org/apache/pekko/coordination/lease/kubernetes/KubernetesApiSpec.scala
Co-authored-by: PJ Fanning <[email protected]>
* Update
lease-kubernetes/src/test/scala/org/apache/pekko/coordination/lease/kubernetes/NativeKubernetesApiSpec.scala
Co-authored-by: PJ Fanning <[email protected]>
---------
Co-authored-by: PJ Fanning <[email protected]>
---
.../kubernetes/AbstractKubernetesApiIntegrationTest.scala | 2 +-
.../lease/kubernetes/KubernetesApiIntegrationTest.scala | 0
.../lease/kubernetes/LeaseContentionSpec.scala | 2 +-
.../{ => coordination}/lease/kubernetes/LocalLeaseSpec.scala | 2 +-
.../lease/kubernetes/NativeKubernetesApiIntegrationTest.scala | 0
.../coordination/lease/kubernetes/KubernetesApiSpec.scala | 4 ++--
.../pekko/coordination/lease/kubernetes/LeaseActorSpec.scala | 10 +++++-----
.../lease/kubernetes/NativeKubernetesApiSpec.scala | 4 ++--
8 files changed, 12 insertions(+), 12 deletions(-)
diff --git
a/lease-kubernetes-int-test/src/test/scala/org/apache/pekko/lease/kubernetes/AbstractKubernetesApiIntegrationTest.scala
b/lease-kubernetes-int-test/src/test/scala/org/apache/pekko/coordination/lease/kubernetes/AbstractKubernetesApiIntegrationTest.scala
similarity index 98%
rename from
lease-kubernetes-int-test/src/test/scala/org/apache/pekko/lease/kubernetes/AbstractKubernetesApiIntegrationTest.scala
rename to
lease-kubernetes-int-test/src/test/scala/org/apache/pekko/coordination/lease/kubernetes/AbstractKubernetesApiIntegrationTest.scala
index d391d225..a01191df 100644
---
a/lease-kubernetes-int-test/src/test/scala/org/apache/pekko/lease/kubernetes/AbstractKubernetesApiIntegrationTest.scala
+++
b/lease-kubernetes-int-test/src/test/scala/org/apache/pekko/coordination/lease/kubernetes/AbstractKubernetesApiIntegrationTest.scala
@@ -114,7 +114,7 @@ abstract class AbstractKubernetesApiIntegrationTest extends
TestKit(ActorSystem(
success.time shouldEqual timeUpdate
}
- "not be able to update a lease if resource version is correct" in {
+ "not be able to update a lease if resource version is incorrect" in {
val timeUpdate = System.currentTimeMillis()
val leaseRecord = underTest.updateLeaseResource(leaseName, client1,
"10", time = timeUpdate).futureValue
val failure: LeaseResource = leaseRecord match {
diff --git
a/lease-kubernetes-int-test/src/test/scala/org/apache/pekko/lease/kubernetes/KubernetesApiIntegrationTest.scala
b/lease-kubernetes-int-test/src/test/scala/org/apache/pekko/coordination/lease/kubernetes/KubernetesApiIntegrationTest.scala
similarity index 100%
rename from
lease-kubernetes-int-test/src/test/scala/org/apache/pekko/lease/kubernetes/KubernetesApiIntegrationTest.scala
rename to
lease-kubernetes-int-test/src/test/scala/org/apache/pekko/coordination/lease/kubernetes/KubernetesApiIntegrationTest.scala
diff --git
a/lease-kubernetes-int-test/src/test/scala/org/apache/pekko/lease/kubernetes/LeaseContentionSpec.scala
b/lease-kubernetes-int-test/src/test/scala/org/apache/pekko/coordination/lease/kubernetes/LeaseContentionSpec.scala
similarity index 98%
rename from
lease-kubernetes-int-test/src/test/scala/org/apache/pekko/lease/kubernetes/LeaseContentionSpec.scala
rename to
lease-kubernetes-int-test/src/test/scala/org/apache/pekko/coordination/lease/kubernetes/LeaseContentionSpec.scala
index 5f794e57..6ca285b6 100644
---
a/lease-kubernetes-int-test/src/test/scala/org/apache/pekko/lease/kubernetes/LeaseContentionSpec.scala
+++
b/lease-kubernetes-int-test/src/test/scala/org/apache/pekko/coordination/lease/kubernetes/LeaseContentionSpec.scala
@@ -71,7 +71,7 @@ class LeaseContentionSpec extends
TestKit(ActorSystem("LeaseContentionSpec",
"A lease under contention" should {
- "only allow one client to get acquire lease" in {
+ "only allow one client to acquire lease" in {
val underTest = LeaseProvider(system)
val nrClients = 30
implicit val ec: ExecutionContext =
ExecutionContext.fromExecutor(Executors.newFixedThreadPool(nrClients)) // too
many = HTTP request queue of pool fills up
diff --git
a/lease-kubernetes-int-test/src/test/scala/org/apache/pekko/lease/kubernetes/LocalLeaseSpec.scala
b/lease-kubernetes-int-test/src/test/scala/org/apache/pekko/coordination/lease/kubernetes/LocalLeaseSpec.scala
similarity index 95%
rename from
lease-kubernetes-int-test/src/test/scala/org/apache/pekko/lease/kubernetes/LocalLeaseSpec.scala
rename to
lease-kubernetes-int-test/src/test/scala/org/apache/pekko/coordination/lease/kubernetes/LocalLeaseSpec.scala
index f8946daa..ee7da0ba 100644
---
a/lease-kubernetes-int-test/src/test/scala/org/apache/pekko/lease/kubernetes/LocalLeaseSpec.scala
+++
b/lease-kubernetes-int-test/src/test/scala/org/apache/pekko/coordination/lease/kubernetes/LocalLeaseSpec.scala
@@ -11,7 +11,7 @@
* Copyright (C) 2017-2021 Lightbend Inc. <https://www.lightbend.com>
*/
-package org.apache.pekko.lease.kubernetes
+package org.apache.pekko.coordination.lease.kubernetes
import com.typesafe.config.ConfigFactory
import org.apache.pekko
diff --git
a/lease-kubernetes-int-test/src/test/scala/org/apache/pekko/lease/kubernetes/NativeKubernetesApiIntegrationTest.scala
b/lease-kubernetes-int-test/src/test/scala/org/apache/pekko/coordination/lease/kubernetes/NativeKubernetesApiIntegrationTest.scala
similarity index 100%
rename from
lease-kubernetes-int-test/src/test/scala/org/apache/pekko/lease/kubernetes/NativeKubernetesApiIntegrationTest.scala
rename to
lease-kubernetes-int-test/src/test/scala/org/apache/pekko/coordination/lease/kubernetes/NativeKubernetesApiIntegrationTest.scala
diff --git
a/lease-kubernetes/src/test/scala/org/apache/pekko/coordination/lease/kubernetes/KubernetesApiSpec.scala
b/lease-kubernetes/src/test/scala/org/apache/pekko/coordination/lease/kubernetes/KubernetesApiSpec.scala
index 3b1943cc..92e85d10 100644
---
a/lease-kubernetes/src/test/scala/org/apache/pekko/coordination/lease/kubernetes/KubernetesApiSpec.scala
+++
b/lease-kubernetes/src/test/scala/org/apache/pekko/coordination/lease/kubernetes/KubernetesApiSpec.scala
@@ -218,7 +218,7 @@ class KubernetesApiSpec
response shouldEqual Done
}
- "timeout on readLease" in {
+ "timeout on readOrCreateLeaseResource" in {
val owner = "client1"
val lease = "lease-1"
val version = "2"
@@ -290,7 +290,7 @@ class KubernetesApiSpec
s"Timed out updating lease [$lease] to owner [$owner]. It is not known
if the update happened. Is the API server up?"
}
- "timeout on remove lease " in {
+ "timeout on remove lease" in {
val lease = "lease-1"
stubFor(
delete(urlEqualTo(s"/apis/pekko.apache.org/v1/namespaces/lease/leases/$lease")).willReturn(
diff --git
a/lease-kubernetes/src/test/scala/org/apache/pekko/coordination/lease/kubernetes/LeaseActorSpec.scala
b/lease-kubernetes/src/test/scala/org/apache/pekko/coordination/lease/kubernetes/LeaseActorSpec.scala
index 989c172a..02037f74 100644
---
a/lease-kubernetes/src/test/scala/org/apache/pekko/coordination/lease/kubernetes/LeaseActorSpec.scala
+++
b/lease-kubernetes/src/test/scala/org/apache/pekko/coordination/lease/kubernetes/LeaseActorSpec.scala
@@ -92,7 +92,7 @@ class LeaseActorSpec
senderProbe.expectMsg(Failure(k8sApiFailure))
}
- "allow acquire after initial failure on rad" in new Test {
+ "allow acquire after initial failure on read" in new Test {
k8sApiFailureDuringRead()
acquireLease()
}
@@ -103,7 +103,7 @@ class LeaseActorSpec
senderProbe.expectMsg(LeaseAcquired)
}
- "fail if grating takes longer than the heartbeat timeout" in new Test {
+ "fail if granting takes longer than the heartbeat timeout" in new Test {
underTest ! LeaseActor.Acquire()
leaseProbe.expectMsg(leaseName)
leaseProbe.reply(LeaseResource(None, currentVersion,
System.currentTimeMillis()))
@@ -200,7 +200,7 @@ class LeaseActorSpec
}
}
- "released lock should be acquireable" in new Test {
+ "released lock should be acquirable" in new Test {
acquireLease()
releaseLease()
// Version from the previous lock so can skip the read of the resource
unless the CAS fails
@@ -279,14 +279,14 @@ class LeaseActorSpec
}
}
- "lock should be acquireable after heart beat conflict" in new Test {
+ "lock should be acquirable after heart beat conflict" in new Test {
acquireLease()
expectHeartBeat()
heartBeatConflict()
acquireLease()
}
- "lock should be acquireable after heart beat fail" in new Test {
+ "lock should be acquirable after heart beat fail" in new Test {
acquireLease()
expectHeartBeat()
heartBeatFailure()
diff --git
a/lease-kubernetes/src/test/scala/org/apache/pekko/coordination/lease/kubernetes/NativeKubernetesApiSpec.scala
b/lease-kubernetes/src/test/scala/org/apache/pekko/coordination/lease/kubernetes/NativeKubernetesApiSpec.scala
index f18e11d7..9fd58677 100644
---
a/lease-kubernetes/src/test/scala/org/apache/pekko/coordination/lease/kubernetes/NativeKubernetesApiSpec.scala
+++
b/lease-kubernetes/src/test/scala/org/apache/pekko/coordination/lease/kubernetes/NativeKubernetesApiSpec.scala
@@ -199,7 +199,7 @@ class NativeKubernetesApiSpec
response shouldEqual Done
}
- "timeout on readLease" in {
+ "timeout on readOrCreateLeaseResource" in {
val owner = "client1"
val lease = "lease-1"
val version = "2"
@@ -270,7 +270,7 @@ class NativeKubernetesApiSpec
s"Timed out updating lease [$lease] to owner [$owner]. It is not known
if the update happened. Is the API server up?"
}
- "timeout on remove lease " in {
+ "timeout on remove lease" in {
val lease = "lease-1"
stubFor(
delete(urlEqualTo(s"/apis/coordination.k8s.io/v1/namespaces/lease/leases/$lease")).willReturn(
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]