Skip to content

Commit

Permalink
refactor: Replace expectNoMsg with expectNoMessage to fix deprecation…
Browse files Browse the repository at this point in the history
… warnings
  • Loading branch information
Marc Zoeller authored and Valentina Glagoleva committed Apr 13, 2021
1 parent b50667d commit e3c926c
Show file tree
Hide file tree
Showing 11 changed files with 81 additions and 81 deletions.
Expand Up @@ -73,15 +73,15 @@ class JavaSessionSpec extends ExtrasJobSpecBase(JavaSessionSpec.getNewSystem) {
expectMsgPF(120 seconds, "Did not get JobResult") {
case JobResult(_, result: Long) => result should equal (3L)
}
expectNoMsg()
expectNoMessage()

manager ! JobManagerActor.StartJob(hiveQueryClass, Seq(testJar), queryConfig, syncEvents ++ errorEvents)
expectMsgPF(6 seconds, "Did not get JobResult") {
case JobResult(_, result: Array[Row]) =>
result should have length 2
result(0)(0) should equal ("Bob")
}
expectNoMsg()
expectNoMessage()
}

/**
Expand Down
Expand Up @@ -72,7 +72,7 @@ class SessionJobSpec extends ExtrasJobSpecBase(SessionJobSpec.getNewSystem) {
expectMsgPF(120 seconds, "Did not get JobResult") {
case JobResult(_, result: Long) => result should equal (3L)
}
expectNoMsg(1.seconds)
expectNoMessage(1.seconds)

manager ! JobManagerActor.StartJob(
hiveQueryClass, Seq(testBinInfo), queryConfig, syncEvents ++ errorEvents)
Expand All @@ -81,7 +81,7 @@ class SessionJobSpec extends ExtrasJobSpecBase(SessionJobSpec.getNewSystem) {
result should have length 2
result(0)(0) should equal ("Bob")
}
expectNoMsg(1.seconds)
expectNoMessage(1.seconds)
}

/**
Expand Down
Expand Up @@ -76,7 +76,7 @@ class StreamingJobSpec extends JobSpecBase(StreamingJobSpec.getNewSystem) {
jobid
}
}
expectNoMsg(2.seconds)
expectNoMessage(2.seconds)

Thread sleep 1000
val jobInfo = Await.result(daoActor ? GetJobInfo(jobId), 60 seconds).asInstanceOf[Option[JobInfo]]
Expand Down Expand Up @@ -150,7 +150,7 @@ class StreamingJobSpec extends JobSpecBase(StreamingJobSpec.getNewSystem) {
ConfigFactory.parseString(s"${JobserverConfig.STOP_CONTEXT_ON_JOB_ERROR}=false"))
triggerFailingStreamingJob(ctxConfig)

deathWatch.expectNoMsg(1.seconds)
deathWatch.expectNoMessage(1.seconds)
}

it("should automatically stop a streaming context if" +
Expand Down
Expand Up @@ -46,7 +46,7 @@ class PythonJobManagerSpec extends ExtrasJobSpecBase(PythonJobManagerSpec.getNew
}
case JobErroredOut(_, _, error: Throwable) => throw error
}
expectNoMsg()
expectNoMessage()
}

it("should execute eggs") {
Expand Down Expand Up @@ -83,7 +83,7 @@ class PythonJobManagerSpec extends ExtrasJobSpecBase(PythonJobManagerSpec.getNew
case JobLoadingError(error: Throwable) =>
error.getMessage should be ("Python should have exactly one package file! Found: 2")
}
expectNoMsg()
expectNoMessage()
}
}
}
Expand Up @@ -171,7 +171,7 @@ abstract class SBRMultiJvmSpec extends MultiNodeSpec(SBRMultiJvmSpecConfig)
expectMsg(timeout, ShutDownAnotherNode(addressesCache(oldestMember)))
} else {
// all other nodes should do nothing
expectNoMsg(timeout)
expectNoMessage(timeout)
}
}
enterBarrier("Oldest node shut down itself and secondary oldest downed oldest on the other side.")
Expand Down Expand Up @@ -228,7 +228,7 @@ abstract class SBRMultiJvmSpec extends MultiNodeSpec(SBRMultiJvmSpecConfig)
expectMsg(timeout, ShutDownAnotherNode(addressesCache(isolatedNode)))
} else {
// all other nodes should do nothing
expectNoMsg(timeout)
expectNoMessage(timeout)
}
}
enterBarrier("Network split resolved.")
Expand Down Expand Up @@ -294,7 +294,7 @@ abstract class SBRMultiJvmSpec extends MultiNodeSpec(SBRMultiJvmSpecConfig)
}
} else {
// all other nodes do nothing
expectNoMsg()
expectNoMessage()
}
}
enterBarrier("Network split resolved.")
Expand Down
24 changes: 12 additions & 12 deletions job-server/src/test/scala/akka/downing/KeepOldestAutoDownSpec.scala
Expand Up @@ -99,7 +99,7 @@ class OldestAutoDowningSpec extends TestKit(ActorSystem("OldestAutoDowningSpec")
)))
othersNodeDowningProvider ! CurrentClusterState(members = initialMembersByAge)
othersNodeDowningProvider ! UnreachableMember(membersWithOtherRolesByAge.head)
expectNoMsg(3.seconds)
expectNoMessage(3.seconds)
}

it("should not down unreachable if not the oldest node (with some other role)") {
Expand All @@ -109,7 +109,7 @@ class OldestAutoDowningSpec extends TestKit(ActorSystem("OldestAutoDowningSpec")
)))
othersNodeDowningProvider ! CurrentClusterState(members = initialMembersByAge)
othersNodeDowningProvider ! UnreachableMember(membersWithOtherRolesByAge.tail.head)
expectNoMsg(3.seconds)
expectNoMessage(3.seconds)
}

it("if oldest is removed, second oldest should become oldest and remove nodes") {
Expand All @@ -136,7 +136,7 @@ class OldestAutoDowningSpec extends TestKit(ActorSystem("OldestAutoDowningSpec")
)))
oldestDowningProviderWithTimeout ! CurrentClusterState(members = initialMembersByAge)
oldestDowningProviderWithTimeout ! UnreachableMember(membersWithOtherRolesByAge.head)
expectNoMsg(3.seconds)
expectNoMessage(3.seconds)
expectMsg(DownCalled(membersWithOtherRolesByAge.head.address))
}

Expand Down Expand Up @@ -172,7 +172,7 @@ class OldestAutoDowningSpec extends TestKit(ActorSystem("OldestAutoDowningSpec")
)))
someOtherNode ! CurrentClusterState(members = initialMembersByAge)
someOtherNode ! UnreachableMember(membersWithDowningRoleByAge.head)
expectNoMsg(3.seconds)
expectNoMessage(3.seconds)
}
}

Expand All @@ -190,7 +190,7 @@ class OldestAutoDowningSpec extends TestKit(ActorSystem("OldestAutoDowningSpec")
)))
othersNodeDowningProvider ! CurrentClusterState(members = initialMembersByAge)
othersNodeDowningProvider ! UnreachableMember(secondOldestMember)
expectNoMsg(3.seconds)
expectNoMessage(3.seconds)
}

it("if oldest is removed, second oldest should become oldest and remove nodes") {
Expand All @@ -211,7 +211,7 @@ class OldestAutoDowningSpec extends TestKit(ActorSystem("OldestAutoDowningSpec")
)))
oldestDowningProviderWithTimeout ! CurrentClusterState(members = initialMembersByAge)
oldestDowningProviderWithTimeout ! UnreachableMember(secondOldestMember)
expectNoMsg(3.seconds)
expectNoMessage(3.seconds)
expectMsg(DownCalled(secondOldestMember.address))
}

Expand All @@ -225,7 +225,7 @@ class OldestAutoDowningSpec extends TestKit(ActorSystem("OldestAutoDowningSpec")
it("should not down unreachable node if it's already in a state Down (not yet removed)") {
oldestDowningProvider ! CurrentClusterState(members = initialMembersByAge)
oldestDowningProvider ! UnreachableMember(someMember.copy(Down))
expectNoMsg(3.seconds)
expectNoMessage(3.seconds)
}

it("should not down another node even if previous was not yet removed from cluster") {
Expand Down Expand Up @@ -312,9 +312,9 @@ class OldestAutoDowningSpec extends TestKit(ActorSystem("OldestAutoDowningSpec")
)))
oldestDowningProviderWithLongerTimeout ! CurrentClusterState(members = initialMembersByAge)
oldestDowningProviderWithLongerTimeout ! UnreachableMember(secondOldestMember)
expectNoMsg(2.seconds)
expectNoMessage(2.seconds)
oldestDowningProviderWithLongerTimeout ! ReachableMember(secondOldestMember)
expectNoMsg(3.seconds)
expectNoMessage(3.seconds)
}

it("should not do anything if unreacheable member was removed during waiting for timeout") {
Expand All @@ -325,7 +325,7 @@ class OldestAutoDowningSpec extends TestKit(ActorSystem("OldestAutoDowningSpec")
oldestDowningProviderWithTimeout ! CurrentClusterState(members = initialMembersByAge)
oldestDowningProviderWithTimeout ! UnreachableMember(secondOldestMember)
oldestDowningProviderWithTimeout ! MemberRemoved(secondOldestMember.copy(Removed), Down)
expectNoMsg(3.seconds)
expectNoMessage(3.seconds)
}

it("should not down the node if not the oldest and oldest is alone unreachable") {
Expand All @@ -335,7 +335,7 @@ class OldestAutoDowningSpec extends TestKit(ActorSystem("OldestAutoDowningSpec")
)))
othersNodeDowningProvider ! CurrentClusterState(members = initialMembersByAge)
othersNodeDowningProvider ! UnreachableMember(initialMembersByAge.head)
expectNoMsg(3.seconds)
expectNoMessage(3.seconds)
}

it("should not down the node if not the oldest and oldest is alone unreachable even though there are" +
Expand All @@ -348,7 +348,7 @@ class OldestAutoDowningSpec extends TestKit(ActorSystem("OldestAutoDowningSpec")
othersNodeDowningProvider ! CurrentClusterState(members = initialMembersByAge)
othersNodeDowningProvider ! ReachableMember(joiningMember)
othersNodeDowningProvider ! UnreachableMember(initialMembersByAge.head)
expectNoMsg(3.seconds)
expectNoMessage(3.seconds)
}

it("should down joining node if it becomes unreachable after a while") {
Expand Down
Expand Up @@ -596,7 +596,7 @@ class AkkaClusterSupervisorActorSpec extends TestKit(AkkaClusterSupervisorActorS

supervisor ! ActorIdentity(unusedDummyInput, Some(managerProbe.ref))
deathWatch.expectTerminated(managerProbe.ref)
expectNoMsg((SparkJobUtils.getForkedJVMInitTimeout(system.settings.config) + 1).second)
expectNoMessage((SparkJobUtils.getForkedJVMInitTimeout(system.settings.config) + 1).second)

supervisor ! StubbedAkkaClusterSupervisorActor.EnableDAOCommunication
}
Expand Down Expand Up @@ -700,7 +700,7 @@ class AkkaClusterSupervisorActorSpec extends TestKit(AkkaClusterSupervisorActorS
it("should not receive JVM creation timed out error if context was intialized properly") {
supervisor ! AddContext("test-context-proper-init", contextConfig)
expectMsg(contextInitTimeout, ContextInitialized)
expectNoMsg((SparkJobUtils.getForkedJVMInitTimeout(system.settings.config) + 1).second)
expectNoMessage((SparkJobUtils.getForkedJVMInitTimeout(system.settings.config) + 1).second)
}
}

Expand Down

0 comments on commit e3c926c

Please sign in to comment.