File tree Expand file tree Collapse file tree 2 files changed +14
-4
lines changed Expand file tree Collapse file tree 2 files changed +14
-4
lines changed Original file line number Diff line number Diff line change @@ -205,6 +205,11 @@ class Heartbeat {
205205 await this . state . clearHeartbeat ( )
206206 } catch { }
207207 }
208+
209+ /** Mimics a crash, only for testing */
210+ public testCrash ( ) {
211+ globals . clock . clearInterval ( this . intervalRef )
212+ }
208213}
209214
210215/**
@@ -312,10 +317,15 @@ class CrashChecker {
312317 }
313318 }
314319
315- /** Use this on failures */
320+ /** Use this on failures to terminate the crash checker */
316321 public cleanup ( ) {
317322 globals . clock . clearInterval ( this . intervalRef )
318323 }
324+
325+ /** Mimics a crash, only for testing */
326+ public testCrash ( ) {
327+ globals . clock . clearInterval ( this . intervalRef )
328+ }
319329}
320330
321331/**
Original file line number Diff line number Diff line change @@ -14,10 +14,10 @@ class TestCrashMonitoring extends CrashMonitoring {
1414 public constructor ( ...deps : ConstructorParameters < typeof CrashMonitoring > ) {
1515 super ( ...deps )
1616 }
17- /** Immitates an extension crash */
17+ /** Imitates an extension crash */
1818 public async crash ( ) {
19- this . crashChecker ?. cleanup ( )
20- await this . heartbeat ?. cleanup ( )
19+ this . crashChecker ?. testCrash ( )
20+ this . heartbeat ?. testCrash ( )
2121 }
2222}
2323
You can’t perform that action at this time.
0 commit comments