Closed perimosocordiae closed 11 years ago
This problem is even more manifest in the new indexedDB
-based FS. Somewhere along the way during the loadFixtures
call, the setImmediate
wrapper isn't used and the test runner assumes everything is ready, when in fact no callback from either mkdir
has been fired.
My idea is to have a counter that's initialized to 0. We increment it by 1 when wrapCb
is called (https://github.com/jvilk/BrowserFS/blob/master/src/core/node_fs.coffee#L5), and decrement it by 1 when the setImmediate
portion of the wrapped cb is called. This should provide us with the semantics we want: The process has "exited" once all filesystem API calls have completed.
I tried implementing this locally, but it did not terminate. This means that we could have a silent bug where the callback isn't being triggered properly.
See commit b7d3d41f27d83a9ef755ba2d1ce982169564bb62.
Even with the hackfix, it's still possible to get errors on occasion.