File tree Expand file tree Collapse file tree 2 files changed +21
-6
lines changed
Test/Unit/Step/PostDeploy Expand file tree Collapse file tree 2 files changed +21
-6
lines changed Original file line number Diff line number Diff line change @@ -67,9 +67,21 @@ public function __construct(
67
67
public function execute ()
68
68
{
69
69
try {
70
- $ this ->logger ->info ('Starting page warming up ' );
70
+ $ this ->logger ->info ('Starting page warmup ' );
71
71
$ config = [];
72
72
73
+ $ concurrency = $ this ->postDeploy ->get (PostDeployInterface::VAR_WARM_UP_CONCURRENCY );
74
+ if ($ concurrency ) {
75
+ $ config ['concurrency ' ] = $ concurrency ;
76
+ $ this ->logger ->info (
77
+ sprintf (
78
+ 'Warmup concurrency set to %s as specified by the %s configuration ' ,
79
+ $ concurrency ,
80
+ PostDeployInterface::VAR_WARM_UP_CONCURRENCY
81
+ )
82
+ );
83
+ }
84
+
73
85
$ urls = $ this ->urls ->getAll ();
74
86
75
87
$ config ['fulfilled ' ] = function ($ response , $ index ) use ($ urls ) {
@@ -95,11 +107,6 @@ public function execute()
95
107
$ this ->logger ->error ('Warming up failed: ' . $ urls [$ index ], $ context );
96
108
};
97
109
98
- $ concurrency = $ this ->postDeploy ->get (PostDeployInterface::VAR_WARM_UP_CONCURRENCY );
99
- if ($ concurrency ) {
100
- $ config ['concurrency ' ] = $ concurrency ;
101
- }
102
-
103
110
$ pool = $ this ->poolFactory ->create ($ urls , $ config );
104
111
105
112
/** @var PromiseInterface $promise */
Original file line number Diff line number Diff line change @@ -185,6 +185,14 @@ public function testExecuteWithConcurrency()
185
185
];
186
186
$ concurrency = 2 ;
187
187
188
+ $ this ->loggerMock ->expects ($ this ->any ())
189
+ ->method ('info ' )
190
+ ->withConsecutive (
191
+ ['Starting page warmup ' ],
192
+ ['Warmup concurrency set to ' . $ concurrency . ' as specified by the '
193
+ . PostDeployInterface::VAR_WARM_UP_CONCURRENCY . ' configuration ' ]
194
+ );
195
+
188
196
$ this ->urlsMock ->method ('getAll ' )
189
197
->willReturn ($ urls );
190
198
$ this ->postDeployMock ->method ('get ' )
You can’t perform that action at this time.
0 commit comments