mirror of
https://github.com/pulsar-edit/pulsar.git
synced 2024-09-20 07:28:08 +03:00
Warn rather than failing if we detect leaked pathwatcher subscriptions
This commit is contained in:
parent
edcceeed5b
commit
265aa2f6c8
@ -230,9 +230,7 @@ describe('GitRepositoryAsync', () => {
|
||||
})
|
||||
})
|
||||
|
||||
// @joshaber: Disabling for now. There seems to be some race with path
|
||||
// subscriptions leading to intermittent test failures, e.g.: https://travis-ci.org/atom/atom/jobs/102702554
|
||||
xdescribe('.checkoutHeadForEditor(editor)', () => {
|
||||
describe('.checkoutHeadForEditor(editor)', () => {
|
||||
let filePath
|
||||
let editor
|
||||
|
||||
|
@ -112,14 +112,14 @@ afterEach ->
|
||||
|
||||
document.getElementById('jasmine-content').innerHTML = '' unless window.debugContent
|
||||
|
||||
ensureNoPathSubscriptions()
|
||||
warnIfLeakingPathSubscriptions()
|
||||
waits(0) # yield to ui thread to make screen update more frequently
|
||||
|
||||
ensureNoPathSubscriptions = ->
|
||||
warnIfLeakingPathSubscriptions = ->
|
||||
watchedPaths = pathwatcher.getWatchedPaths()
|
||||
pathwatcher.closeAllWatchers()
|
||||
if watchedPaths.length > 0
|
||||
throw new Error("Leaking subscriptions for paths: " + watchedPaths.join(", "))
|
||||
console.error("WARNING: Leaking subscriptions for paths: " + watchedPaths.join(", "))
|
||||
pathwatcher.closeAllWatchers()
|
||||
|
||||
ensureNoDeprecatedFunctionsCalled = ->
|
||||
deprecations = Grim.getDeprecations()
|
||||
|
Loading…
Reference in New Issue
Block a user