@@ -149,6 +149,30 @@ describe(QUICServer.name, () => {
149
149
expect ( typeof quicServer . port ) . toBe ( 'number' ) ;
150
150
await quicServer . stop ( ) ;
151
151
} ) ;
152
+ test ( 'repeated stop and start' , async ( ) => {
153
+ const quicServer = new QUICServer ( {
154
+ crypto : {
155
+ key,
156
+ ops : serverCryptoOps ,
157
+ } ,
158
+ config : {
159
+ key : keyPairRSAPEM . privateKey ,
160
+ cert : certRSAPEM ,
161
+ } ,
162
+ logger : logger . getChild ( 'QUICServer' ) ,
163
+ } ) ;
164
+ socketCleanMethods . extractSocket ( quicServer ) ;
165
+ await quicServer . start ( ) ;
166
+ // Default to dual-stack
167
+ expect ( quicServer . host ) . toBe ( '::' ) ;
168
+ expect ( typeof quicServer . port ) . toBe ( 'number' ) ;
169
+ await quicServer . stop ( ) ;
170
+ await quicServer . start ( ) ;
171
+ // Default to dual-stack
172
+ expect ( quicServer . host ) . toBe ( '::' ) ;
173
+ expect ( typeof quicServer . port ) . toBe ( 'number' ) ;
174
+ await quicServer . stop ( ) ;
175
+ } )
152
176
} ) ;
153
177
describe ( 'binding to host and port' , ( ) => {
154
178
test ( 'listen on IPv4' , async ( ) => {
@@ -211,7 +235,6 @@ describe(QUICServer.name, () => {
211
235
expect ( typeof quicServer . port ) . toBe ( 'number' ) ;
212
236
await quicServer . stop ( ) ;
213
237
} ) ;
214
- // FIXME: this is holding the process open, needs a fix
215
238
test ( 'listen on IPv4 mapped IPv6' , async ( ) => {
216
239
// NOT RECOMMENDED, because send addresses will have to be mapped
217
240
// addresses, which means you can ONLY connect to mapped addresses
0 commit comments