@@ -227,4 +227,41 @@ describe('test/stop.test.js', () => {
227
227
assert ( app2 . stdout . includes ( '[app_worker] exit with code:0' ) ) ;
228
228
} ) ;
229
229
} ) ;
230
+
231
+ describe ( 'stop with symlink' , ( ) => {
232
+ const baseDir = path . join ( __dirname , 'fixtures/tmp' ) ;
233
+
234
+ beforeEach ( function * ( ) {
235
+ yield fs . symlink ( fixturePath , baseDir ) ;
236
+
237
+ yield utils . cleanup ( fixturePath ) ;
238
+ yield rimraf ( logDir ) ;
239
+ yield coffee . fork ( eggBin , [ 'start' , '--daemon' , '--workers=2' ] , { cwd : baseDir } )
240
+ . debug ( )
241
+ . expect ( 'stdout' , new RegExp ( `Starting custom-framework application at ${ fixturePath } ` ) )
242
+ . expect ( 'code' , 0 )
243
+ . end ( ) ;
244
+
245
+ yield rimraf ( baseDir ) ;
246
+ const result = yield httpclient . request ( 'http://127.0.0.1:7001' ) ;
247
+ assert ( result . data . toString ( ) === 'hi, egg' ) ;
248
+ } ) ;
249
+ afterEach ( function * ( ) {
250
+ yield utils . cleanup ( fixturePath ) ;
251
+ yield rimraf ( baseDir ) ;
252
+ } ) ;
253
+
254
+ it ( 'should stop' , function * ( ) {
255
+ yield rimraf ( baseDir ) ;
256
+ yield fs . symlink ( path . join ( __dirname , 'fixtures/status' ) , baseDir ) ;
257
+
258
+ yield coffee . fork ( eggBin , [ 'stop' , baseDir ] )
259
+ . debug ( )
260
+ . expect ( 'stdout' , / \[ e g g - s c r i p t s ] s t o p p i n g e g g a p p l i c a t i o n / )
261
+ . expect ( 'stdout' , / g o t m a s t e r p i d \[ " \d + \" \] / i)
262
+ . expect ( 'code' , 0 )
263
+ . end ( ) ;
264
+ } ) ;
265
+ } ) ;
266
+
230
267
} ) ;
0 commit comments