@@ -399,7 +399,6 @@ describe('ChildProcessTracker', function () {
399399
400400 before ( function ( ) {
401401 clock = installFakeClock ( )
402- tracker = ChildProcessTracker . instance
403402 usageMock = sinon . stub ( ChildProcessTracker . prototype , 'getUsage' )
404403 } )
405404
@@ -415,7 +414,6 @@ describe('ChildProcessTracker', function () {
415414 it ( `removes stopped processes every ${ ChildProcessTracker . pollingInterval / 1000 } seconds` , async function ( ) {
416415 // Start a 'sleep' command, check it only removes after we stop it.
417416 const runningProcess = startSleepProcess ( )
418- tracker . add ( runningProcess . childProcess )
419417 assert . strictEqual ( tracker . has ( runningProcess . childProcess ) , true , 'failed to add sleep command' )
420418
421419 await clock . tickAsync ( ChildProcessTracker . pollingInterval )
@@ -433,8 +431,6 @@ describe('ChildProcessTracker', function () {
433431 it ( 'multiple processes from same command are tracked seperately' , async function ( ) {
434432 const runningProcess1 = startSleepProcess ( )
435433 const runningProcess2 = startSleepProcess ( )
436- tracker . add ( runningProcess1 . childProcess )
437- tracker . add ( runningProcess2 . childProcess )
438434
439435 assert . strictEqual ( tracker . has ( runningProcess1 . childProcess ) , true , 'Missing first process' )
440436 assert . strictEqual ( tracker . has ( runningProcess2 . childProcess ) , true , 'Missing second process' )
@@ -461,7 +457,6 @@ describe('ChildProcessTracker', function () {
461457
462458 it ( 'logs a warning message and emits metric when cpu exceeds threshold' , async function ( ) {
463459 const runningProcess = startSleepProcess ( )
464- tracker . add ( runningProcess . childProcess )
465460
466461 const highCpu : ProcessStats = {
467462 cpu : ChildProcessTracker . thresholds . cpu + 1 ,
@@ -482,7 +477,6 @@ describe('ChildProcessTracker', function () {
482477
483478 it ( 'logs a warning message and emits metric when memory exceeds threshold' , async function ( ) {
484479 const runningProcess = startSleepProcess ( )
485- tracker . add ( runningProcess . childProcess )
486480 const highMemory : ProcessStats = {
487481 cpu : 0 ,
488482 memory : ChildProcessTracker . thresholds . memory + 1 ,
@@ -501,7 +495,6 @@ describe('ChildProcessTracker', function () {
501495
502496 it ( 'includes pid in logs' , async function ( ) {
503497 const runningProcess = startSleepProcess ( )
504- tracker . add ( runningProcess . childProcess )
505498
506499 usageMock . resolves ( {
507500 cpu : ChildProcessTracker . thresholds . cpu + 1 ,
@@ -534,9 +527,6 @@ describe('ChildProcessTracker', function () {
534527 const runningProcess1 = startSleepProcess ( )
535528 const runningProcess2 = startSleepProcess ( )
536529
537- tracker . add ( runningProcess1 . childProcess )
538- tracker . add ( runningProcess2 . childProcess )
539-
540530 assert . ok ( tracker . has ( runningProcess1 . childProcess ) , 'Missing first process' )
541531 assert . ok ( tracker . has ( runningProcess2 . childProcess ) , 'Missing seconds process' )
542532
@@ -561,8 +551,7 @@ describe('ChildProcessTracker', function () {
561551 it ( 'logsAllUsage emits telemetry to number of processes (nonempty)' , async function ( ) {
562552 const size = 10
563553 for ( const _ of Array . from ( { length : size } ) ) {
564- const runningProcess = startSleepProcess ( )
565- tracker . add ( runningProcess . childProcess )
554+ startSleepProcess ( )
566555 }
567556
568557 await tracker . logAllUsage ( )
0 commit comments