@@ -399,7 +399,6 @@ describe('ChildProcessTracker', function () {
399
399
400
400
before ( function ( ) {
401
401
clock = installFakeClock ( )
402
- tracker = ChildProcessTracker . instance
403
402
usageMock = sinon . stub ( ChildProcessTracker . prototype , 'getUsage' )
404
403
} )
405
404
@@ -415,7 +414,6 @@ describe('ChildProcessTracker', function () {
415
414
it ( `removes stopped processes every ${ ChildProcessTracker . pollingInterval / 1000 } seconds` , async function ( ) {
416
415
// Start a 'sleep' command, check it only removes after we stop it.
417
416
const runningProcess = startSleepProcess ( )
418
- tracker . add ( runningProcess . childProcess )
419
417
assert . strictEqual ( tracker . has ( runningProcess . childProcess ) , true , 'failed to add sleep command' )
420
418
421
419
await clock . tickAsync ( ChildProcessTracker . pollingInterval )
@@ -433,8 +431,6 @@ describe('ChildProcessTracker', function () {
433
431
it ( 'multiple processes from same command are tracked seperately' , async function ( ) {
434
432
const runningProcess1 = startSleepProcess ( )
435
433
const runningProcess2 = startSleepProcess ( )
436
- tracker . add ( runningProcess1 . childProcess )
437
- tracker . add ( runningProcess2 . childProcess )
438
434
439
435
assert . strictEqual ( tracker . has ( runningProcess1 . childProcess ) , true , 'Missing first process' )
440
436
assert . strictEqual ( tracker . has ( runningProcess2 . childProcess ) , true , 'Missing second process' )
@@ -461,7 +457,6 @@ describe('ChildProcessTracker', function () {
461
457
462
458
it ( 'logs a warning message and emits metric when cpu exceeds threshold' , async function ( ) {
463
459
const runningProcess = startSleepProcess ( )
464
- tracker . add ( runningProcess . childProcess )
465
460
466
461
const highCpu : ProcessStats = {
467
462
cpu : ChildProcessTracker . thresholds . cpu + 1 ,
@@ -482,7 +477,6 @@ describe('ChildProcessTracker', function () {
482
477
483
478
it ( 'logs a warning message and emits metric when memory exceeds threshold' , async function ( ) {
484
479
const runningProcess = startSleepProcess ( )
485
- tracker . add ( runningProcess . childProcess )
486
480
const highMemory : ProcessStats = {
487
481
cpu : 0 ,
488
482
memory : ChildProcessTracker . thresholds . memory + 1 ,
@@ -501,7 +495,6 @@ describe('ChildProcessTracker', function () {
501
495
502
496
it ( 'includes pid in logs' , async function ( ) {
503
497
const runningProcess = startSleepProcess ( )
504
- tracker . add ( runningProcess . childProcess )
505
498
506
499
usageMock . resolves ( {
507
500
cpu : ChildProcessTracker . thresholds . cpu + 1 ,
@@ -534,9 +527,6 @@ describe('ChildProcessTracker', function () {
534
527
const runningProcess1 = startSleepProcess ( )
535
528
const runningProcess2 = startSleepProcess ( )
536
529
537
- tracker . add ( runningProcess1 . childProcess )
538
- tracker . add ( runningProcess2 . childProcess )
539
-
540
530
assert . ok ( tracker . has ( runningProcess1 . childProcess ) , 'Missing first process' )
541
531
assert . ok ( tracker . has ( runningProcess2 . childProcess ) , 'Missing seconds process' )
542
532
@@ -561,8 +551,7 @@ describe('ChildProcessTracker', function () {
561
551
it ( 'logsAllUsage emits telemetry to number of processes (nonempty)' , async function ( ) {
562
552
const size = 10
563
553
for ( const _ of Array . from ( { length : size } ) ) {
564
- const runningProcess = startSleepProcess ( )
565
- tracker . add ( runningProcess . childProcess )
554
+ startSleepProcess ( )
566
555
}
567
556
568
557
await tracker . logAllUsage ( )
0 commit comments