Skip to content

Commit

Permalink
Fix test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
style95 committed Aug 20, 2021
1 parent 99c95cd commit 6661b33
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import java.{lang, util}
import akka.actor.ActorRef
import akka.actor.FSM.{CurrentState, StateTimeout, SubscribeTransitionCallBack, Transition}
import akka.pattern.ask
import akka.stream.Materializer
import akka.testkit.{ImplicitSender, TestActor, TestFSMRef, TestKit, TestProbe}
import akka.util.Timeout
import com.google.protobuf.ByteString
Expand Down Expand Up @@ -84,8 +83,6 @@ class MemoryQueueTests
Client.forEndpoints(hostAndPorts).withPlainText().build()
}

implicit val materializer = Materializer

def registerCallback(c: ActorRef) = {
c ! SubscribeTransitionCallBack(testActor)
expectMsg(CurrentState(c, Uninitialized))
Expand Down Expand Up @@ -1410,8 +1407,8 @@ class MemoryQueueTests

Thread.sleep(1000)
memoryQueue.containers.size shouldBe 2
memoryQueue.creationIds.size shouldBe 2
memoryQueue.namespaceContainerCount.inProgressContainerNumByNamespace shouldBe 4
memoryQueue.creationIds.size shouldBe 0
memoryQueue.namespaceContainerCount.inProgressContainerNumByNamespace shouldBe 0
memoryQueue.namespaceContainerCount.existingContainerNumByNamespace shouldBe 4

mockEtcdClient.publishEvents(
Expand Down Expand Up @@ -1455,10 +1452,12 @@ class MemoryQueueTests
Some(ContainerId("test-containerId4"))),
"test-value")

memoryQueue.creationIds.size shouldBe 0

Thread.sleep(1000)
memoryQueue.containers.size shouldBe 0
memoryQueue.creationIds.size shouldBe 2
memoryQueue.namespaceContainerCount.inProgressContainerNumByNamespace shouldBe 4
memoryQueue.creationIds.size shouldBe 1 //if there is no container, the queue tries to create one container
memoryQueue.namespaceContainerCount.inProgressContainerNumByNamespace shouldBe 0
memoryQueue.namespaceContainerCount.existingContainerNumByNamespace shouldBe 0
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ class MemoryQueueTestsFixture

// Watcher
val watcherName = s"memory-queue-$fqn-$revision"
val watcherNameForNamespace = s"namespace-container-count-$testInvocationNamespace"
val watcherNameForNamespace = s"container-counter-$testInvocationNamespace"
val testCreationId = CreationId.generate()

// ack
Expand Down

0 comments on commit 6661b33

Please sign in to comment.