@@ -226,12 +226,12 @@ class FunctionPullingContainerPoolTests
226
226
List .empty,
227
227
sendAckToScheduler(producer))))
228
228
229
- pool ! Creation (creationMessage.copy(revision = doc.rev), whiskAction)
229
+ pool ! CreationContainer (creationMessage.copy(revision = doc.rev), whiskAction)
230
230
containers(0 ).expectMsgPF() {
231
231
case Initialize (invocationNamespace, executeAction, schedulerHost, rpcPort, _) => true
232
232
}
233
233
234
- pool ! Creation (creationMessage.copy(revision = doc.rev), whiskAction)
234
+ pool ! CreationContainer (creationMessage.copy(revision = doc.rev), whiskAction)
235
235
containers(1 ).expectMsgPF() {
236
236
case Initialize (invocationNamespace, executeAction, schedulerHost, rpcPort, _) => true
237
237
}
@@ -253,19 +253,19 @@ class FunctionPullingContainerPoolTests
253
253
sendAckToScheduler(producer))))
254
254
255
255
// Start first action
256
- pool ! Creation (creationMessage.copy(revision = doc.rev), whiskAction) // 1 * stdMemory taken
256
+ pool ! CreationContainer (creationMessage.copy(revision = doc.rev), whiskAction) // 1 * stdMemory taken
257
257
containers(0 ).expectMsgPF() {
258
258
case Initialize (invocationNamespace, executeAction, schedulerHost, rpcPort, _) => true
259
259
}
260
260
261
261
// Send second action to the pool
262
- pool ! Creation (creationMessageLarge.copy(revision = bigDoc.rev), bigWhiskAction) // message is too large to be processed immediately.
262
+ pool ! CreationContainer (creationMessageLarge.copy(revision = bigDoc.rev), bigWhiskAction) // message is too large to be processed immediately.
263
263
containers(1 ).expectNoMessage(100 .milliseconds)
264
264
265
265
// First container is removed
266
266
containers(0 ).send(pool, ContainerRemoved (true )) // pool is empty again.
267
267
268
- pool ! Creation (creationMessageLarge.copy(revision = bigDoc.rev), bigWhiskAction)
268
+ pool ! CreationContainer (creationMessageLarge.copy(revision = bigDoc.rev), bigWhiskAction)
269
269
// Second container should run now
270
270
containers(1 ).expectMsgPF() {
271
271
case Initialize (invocationNamespace, bigExecuteAction, schedulerHost, rpcPort, _) => true
@@ -288,7 +288,7 @@ class FunctionPullingContainerPoolTests
288
288
sendAckToScheduler(consumer.getProducer()))))
289
289
290
290
pool ! GracefulShutdown
291
- pool ! Creation (creationMessage.copy(revision = doc.rev), whiskAction) // 1 * stdMemory taken
291
+ pool ! CreationContainer (creationMessage.copy(revision = doc.rev), whiskAction) // 1 * stdMemory taken
292
292
293
293
containers(0 ).expectNoMessage()
294
294
@@ -306,7 +306,7 @@ class FunctionPullingContainerPoolTests
306
306
307
307
// pool should be back to work after enabled again
308
308
pool ! Enable
309
- pool ! Creation (creationMessage.copy(revision = doc.rev), whiskAction) // 1 * stdMemory taken
309
+ pool ! CreationContainer (creationMessage.copy(revision = doc.rev), whiskAction) // 1 * stdMemory taken
310
310
containers(0 ).expectMsgPF() {
311
311
case Initialize (invocationNamespace, executeAction, schedulerHost, rpcPort, _) => true
312
312
}
@@ -412,7 +412,7 @@ class FunctionPullingContainerPoolTests
412
412
containers(1 ).send(pool, ReadyToWork (prewarmedData.copy(memoryLimit = biggerMemory)))
413
413
414
414
// the prewarm container with matched memory should be chose
415
- pool ! Creation (creationMessage.copy(revision = doc.rev), whiskAction)
415
+ pool ! CreationContainer (creationMessage.copy(revision = doc.rev), whiskAction)
416
416
containers(0 ).expectMsgPF() {
417
417
case Initialize (invocationNamespace, executeAction, schedulerHost, rpcPort, _) => true
418
418
}
@@ -423,7 +423,7 @@ class FunctionPullingContainerPoolTests
423
423
}
424
424
425
425
// the prewarm container with bigger memory should not be chose
426
- pool ! Creation (creationMessage.copy(revision = doc.rev), whiskAction)
426
+ pool ! CreationContainer (creationMessage.copy(revision = doc.rev), whiskAction)
427
427
containers(3 ).expectMsgPF() {
428
428
case Initialize (invocationNamespace, executeAction, schedulerHost, rpcPort, _) => true
429
429
}
@@ -452,7 +452,7 @@ class FunctionPullingContainerPoolTests
452
452
containers(1 ).send(pool, ReadyToWork (prewarmedData.copy(memoryLimit = biggestMemory)))
453
453
454
454
// the prewarm container with smallest memory should be chose
455
- pool ! Creation (creationMessage.copy(revision = doc.rev), whiskAction)
455
+ pool ! CreationContainer (creationMessage.copy(revision = doc.rev), whiskAction)
456
456
containers(0 ).expectMsgPF() {
457
457
case Initialize (invocationNamespace, executeAction, schedulerHost, rpcPort, _) => true
458
458
}
@@ -463,7 +463,7 @@ class FunctionPullingContainerPoolTests
463
463
}
464
464
465
465
// the prewarm container with bigger memory should be chose
466
- pool ! Creation (creationMessage.copy(revision = doc.rev), whiskAction)
466
+ pool ! CreationContainer (creationMessage.copy(revision = doc.rev), whiskAction)
467
467
containers(1 ).expectMsgPF() {
468
468
case Initialize (invocationNamespace, executeAction, schedulerHost, rpcPort, _) => true
469
469
}
@@ -475,7 +475,7 @@ class FunctionPullingContainerPoolTests
475
475
476
476
// now free memory is (6 - 3 - 1) * stdMemory, and required 2 * stdMemory, so both two prewarmed containers are not suitable
477
477
// a new container should be created
478
- pool ! Creation (creationMessageLarge.copy(revision = doc.rev), bigWhiskAction)
478
+ pool ! CreationContainer (creationMessageLarge.copy(revision = doc.rev), bigWhiskAction)
479
479
containers(4 ).expectMsgPF() {
480
480
case Initialize (invocationNamespace, executeAction, schedulerHost, rpcPort, _) => true
481
481
}
@@ -502,7 +502,7 @@ class FunctionPullingContainerPoolTests
502
502
containers(0 ).expectMsg(Start (alternativeExec, memoryLimit)) // container0 was prewarmed
503
503
containers(0 ).send(pool, ReadyToWork (prewarmedData.copy(kind = alternativeExec.kind))) // container0 was started
504
504
505
- pool ! Creation (creationMessage.copy(revision = doc.rev), whiskAction)
505
+ pool ! CreationContainer (creationMessage.copy(revision = doc.rev), whiskAction)
506
506
containers(1 ).expectMsgPF() {
507
507
case Initialize (invocationNamespace, executeAction, schedulerHost, rpcPort, _) => true
508
508
}
@@ -526,7 +526,7 @@ class FunctionPullingContainerPoolTests
526
526
containers(0 ).expectMsg(Start (exec, alternativeLimit)) // container0 was prewarmed
527
527
containers(0 ).send(pool, ReadyToWork (prewarmedData.copy(memoryLimit = alternativeLimit))) // container0 was started
528
528
529
- pool ! Creation (creationMessage.copy(revision = doc.rev), whiskAction)
529
+ pool ! CreationContainer (creationMessage.copy(revision = doc.rev), whiskAction)
530
530
containers(1 ).expectMsgPF() {
531
531
case Initialize (invocationNamespace, executeAction, schedulerHost, rpcPort, _) => true
532
532
}
@@ -560,24 +560,24 @@ class FunctionPullingContainerPoolTests
560
560
container.ref)
561
561
562
562
// the revision doesn't match, create 1 container
563
- pool ! Creation (creationMessage, whiskAction)
563
+ pool ! CreationContainer (creationMessage, whiskAction)
564
564
containers(0 ).expectMsgPF() {
565
565
case Initialize (invocationNamespace, executeAction, schedulerHost, rpcPort, _) => true
566
566
}
567
567
568
568
// the invocation namespace doesn't match, create 1 container
569
- pool ! Creation (creationMessage.copy(invocationNamespace = " otherNamespace" ), whiskAction)
569
+ pool ! CreationContainer (creationMessage.copy(invocationNamespace = " otherNamespace" ), whiskAction)
570
570
containers(1 ).expectMsgPF() {
571
571
case Initialize (" otherNamespace" , executeAction, schedulerHost, rpcPort, _) => true
572
572
}
573
573
574
- pool ! Creation (creationMessage.copy(revision = doc.rev), whiskAction)
574
+ pool ! CreationContainer (creationMessage.copy(revision = doc.rev), whiskAction)
575
575
container.expectMsgPF() {
576
576
case Initialize (invocationNamespace, executeAction, schedulerHost, rpcPort, _) => true
577
577
}
578
578
579
579
// warmed container is occupied, create 1 more container
580
- pool ! Creation (creationMessage.copy(revision = doc.rev), whiskAction)
580
+ pool ! CreationContainer (creationMessage.copy(revision = doc.rev), whiskAction)
581
581
containers(2 ).expectMsgPF() {
582
582
case Initialize (invocationNamespace, executeAction, schedulerHost, rpcPort, _) => true
583
583
}
@@ -612,7 +612,7 @@ class FunctionPullingContainerPoolTests
612
612
container.ref)
613
613
614
614
// choose the warmed container
615
- pool ! Creation (creationMessage.copy(revision = doc.rev), whiskAction)
615
+ pool ! CreationContainer (creationMessage.copy(revision = doc.rev), whiskAction)
616
616
container.expectMsgPF() {
617
617
case Initialize (invocationNamespace, executeAction, schedulerHost, rpcPort, _) => true
618
618
}
@@ -687,7 +687,7 @@ class FunctionPullingContainerPoolTests
687
687
container3.ref)
688
688
689
689
// now the pool has no free memory, and new job needs 2*stdMemory, so it needs to remove two warmed containers
690
- pool ! Creation (creationMessage, bigWhiskAction)
690
+ pool ! CreationContainer (creationMessage, bigWhiskAction)
691
691
container1.expectMsg(Remove )
692
692
container2.expectMsg(Remove )
693
693
container3.expectNoMessage()
@@ -736,7 +736,7 @@ class FunctionPullingContainerPoolTests
736
736
val actualCreationMessage = creationMessage.copy(revision = doc.rev)
737
737
val ackMessage = createAckMsg(actualCreationMessage, None , None )
738
738
739
- pool ! Creation (actualCreationMessage, whiskAction)
739
+ pool ! CreationContainer (actualCreationMessage, whiskAction)
740
740
containers(0 ).expectMsgPF() {
741
741
case Initialize (invocationNamespace, executeAction, schedulerHost, rpcPort, _) => true
742
742
}
@@ -784,7 +784,7 @@ class FunctionPullingContainerPoolTests
784
784
container.ref)
785
785
786
786
// choose the warmed container
787
- pool ! Creation (creationMessage.copy(revision = doc.rev), whiskAction)
787
+ pool ! CreationContainer (creationMessage.copy(revision = doc.rev), whiskAction)
788
788
container.expectMsgPF() {
789
789
case Initialize (invocationNamespace, executeAction, schedulerHost, rpcPort, _) => true
790
790
}
@@ -830,7 +830,7 @@ class FunctionPullingContainerPoolTests
830
830
val ackMessage =
831
831
createAckMsg(actualCreationMessageLarge, Some (ResourceNotEnoughError ), Some (error))
832
832
833
- pool ! Creation (actualCreationMessageLarge, bigWhiskAction)
833
+ pool ! CreationContainer (actualCreationMessageLarge, bigWhiskAction)
834
834
835
835
utilRetry({
836
836
val buffer = consumer.peek(50 .millisecond)
@@ -842,7 +842,7 @@ class FunctionPullingContainerPoolTests
842
842
val actualCreationMessage = creationMessage.copy(revision = doc2.rev)
843
843
val rescheduleAckMsg = createAckMsg(actualCreationMessage, Some (UnknownError ), Some (" ContainerProxy init failed." ))
844
844
845
- pool ! Creation (actualCreationMessage, whiskAction)
845
+ pool ! CreationContainer (actualCreationMessage, whiskAction)
846
846
containers(0 ).expectMsgPF() {
847
847
case Initialize (invocationNamespace, executeAction, schedulerHost, rpcPort, _) => true
848
848
}
@@ -883,9 +883,9 @@ class FunctionPullingContainerPoolTests
883
883
sendAckToScheduler(producer))))
884
884
containers(0 ).expectMsg(Start (exec, memoryLimit))
885
885
886
- pool ! Creation (creationMessage.copy(revision = doc.rev), whiskAction)
887
- pool ! Creation (creationMessage.copy(revision = doc.rev), whiskAction)
888
- pool ! Creation (creationMessage.copy(revision = doc.rev), whiskAction)
886
+ pool ! CreationContainer (creationMessage.copy(revision = doc.rev), whiskAction)
887
+ pool ! CreationContainer (creationMessage.copy(revision = doc.rev), whiskAction)
888
+ pool ! CreationContainer (creationMessage.copy(revision = doc.rev), whiskAction)
889
889
890
890
awaitAssert {
891
891
count shouldBe 3
@@ -1011,11 +1011,11 @@ class FunctionPullingContainerPoolTests
1011
1011
stream.toString should not include (s " removed ${initialCount} expired prewarmed container " )
1012
1012
1013
1013
// 2 cold start happened
1014
- pool ! Creation (creationMessage.copy(revision = doc.rev), whiskAction)
1014
+ pool ! CreationContainer (creationMessage.copy(revision = doc.rev), whiskAction)
1015
1015
containers(2 ).expectMsgPF() {
1016
1016
case Initialize (invocationNamespace, executeAction, schedulerHost, rpcPort, _) => true
1017
1017
}
1018
- pool ! Creation (creationMessage.copy(revision = doc.rev), whiskAction)
1018
+ pool ! CreationContainer (creationMessage.copy(revision = doc.rev), whiskAction)
1019
1019
containers(3 ).expectMsgPF() {
1020
1020
case Initialize (invocationNamespace, executeAction, schedulerHost, rpcPort, _) => true
1021
1021
}
@@ -1049,23 +1049,23 @@ class FunctionPullingContainerPoolTests
1049
1049
stream.reset()
1050
1050
1051
1051
// 5 code start happened(5 > maxCount)
1052
- pool ! Creation (creationMessage.copy(revision = doc.rev), whiskAction)
1052
+ pool ! CreationContainer (creationMessage.copy(revision = doc.rev), whiskAction)
1053
1053
containers(6 ).expectMsgPF() {
1054
1054
case Initialize (invocationNamespace, executeAction, schedulerHost, rpcPort, _) => true
1055
1055
}
1056
- pool ! Creation (creationMessage.copy(revision = doc.rev), whiskAction)
1056
+ pool ! CreationContainer (creationMessage.copy(revision = doc.rev), whiskAction)
1057
1057
containers(7 ).expectMsgPF() {
1058
1058
case Initialize (invocationNamespace, executeAction, schedulerHost, rpcPort, _) => true
1059
1059
}
1060
- pool ! Creation (creationMessage.copy(revision = doc.rev), whiskAction)
1060
+ pool ! CreationContainer (creationMessage.copy(revision = doc.rev), whiskAction)
1061
1061
containers(8 ).expectMsgPF() {
1062
1062
case Initialize (invocationNamespace, executeAction, schedulerHost, rpcPort, _) => true
1063
1063
}
1064
- pool ! Creation (creationMessage.copy(revision = doc.rev), whiskAction)
1064
+ pool ! CreationContainer (creationMessage.copy(revision = doc.rev), whiskAction)
1065
1065
containers(9 ).expectMsgPF() {
1066
1066
case Initialize (invocationNamespace, executeAction, schedulerHost, rpcPort, _) => true
1067
1067
}
1068
- pool ! Creation (creationMessage.copy(revision = doc.rev), whiskAction)
1068
+ pool ! CreationContainer (creationMessage.copy(revision = doc.rev), whiskAction)
1069
1069
containers(10 ).expectMsgPF() {
1070
1070
case Initialize (invocationNamespace, executeAction, schedulerHost, rpcPort, _) => true
1071
1071
}
0 commit comments