File tree Expand file tree Collapse file tree 3 files changed +8
-9
lines changed
Expand file tree Collapse file tree 3 files changed +8
-9
lines changed Original file line number Diff line number Diff line change @@ -5,8 +5,8 @@ const cluster = require( 'cluster' );
55class HeapWatch {
66 constructor ( conf , logger , metrics ) {
77 if ( metrics !== null ) {
8- const prometheusOptions = metrics . options . find ( ( option ) =>
9- option . type === 'prometheus' && option . collect_default === true
8+ const prometheusOptions = metrics . options . find (
9+ ( option ) => option . type === 'prometheus' && option . collect_default === true
1010 ) ;
1111 // When true, a noop dummy metric will be instantiated
1212 // and passed down to a PrometheusClient instance.
Original file line number Diff line number Diff line change @@ -119,7 +119,6 @@ class Worker extends BaseService {
119119 // For 0.10: npm install heapdump
120120 process . on ( 'SIGUSR2' , this . _dumpHeapHandler = ( ) => {
121121 try {
122- // eslint-disable-next-line n/no-missing-require
123122 const heapdump = require ( 'heapdump' ) ;
124123 const cwd = process . cwd ( ) ;
125124 console . error ( 'SIGUSR2 received! Writing snapshot.' ) ;
Original file line number Diff line number Diff line change @@ -105,11 +105,13 @@ describe( 'service-runner tests', () => {
105105 const server = new TestServer ( `${ __dirname } /../utils/simple_config_no_workers_collect_default.yaml` ) ;
106106 const response = { status : null , body : null } ;
107107 return server . start ( )
108- . then ( ( ) => {
109- preq . get ( { uri : 'http://127.0.0.1:9000' } )
110- . then ( ( res ) => {
108+ . then ( async ( ) => {
109+ // eslint-disable-next-line n/no-unsupported-features/node-builtins
110+ await fetch ( 'http://127.0.0.1:9000' )
111+ . then ( async ( res ) => {
111112 response . status = res . status ;
112- response . body = res . body ;
113+ // This is a ReadableStream of a Uint8Array, but we just want the string
114+ response . body = new TextDecoder ( ) . decode ( await res . arrayBuffer ( ) ) ;
113115 } ) ;
114116 } )
115117 . delay ( 1000 )
@@ -123,8 +125,6 @@ describe( 'service-runner tests', () => {
123125 . finally ( ( ) => server . stop ( ) ) ;
124126 } ) ;
125127
126- // preq prevents the AssertionErrors from surfacing and failing the test
127- // performing the test this way presents them correctly
128128 it ( 'Must increment hitcount metrics when hit, no workers' , ( ) => {
129129 const server = new TestServer ( `${ __dirname } /../utils/simple_config_no_workers.yaml` ) ;
130130 const response = { status : null , body : null } ;
You can’t perform that action at this time.
0 commit comments