-
Notifications
You must be signed in to change notification settings - Fork 7.6k
ProjectManager.getAllFiles() order not consistent between OSs #9448
Comments
Seems to be related to #8889, at least in the common test failures. |
Well, this issue is about the CSSInlineEdit tests (which were BTW added this release), while #8889 is about the failing QuickOpen tests |
The link to the issue on google groups (https://groups.google.com/d/msg/brackets-dev/sLouD1zl6Nk/4jQ6-ErFo2cJ) referred to Quick Open tests: Andrew MacKenzie says:
|
But I investigated the failing CSSInlineEdit test ;) |
Ah, I see. Sorry for misunderstanding. |
The getAllFiles() API isn't intended to return a sorted list -- the order is actually nondeterministic, and can vary even on the same machine depending on IO timing. We discussed this today and agreed the API should stay unsorted (I'll see about tweaking the docs to make that more clear). Closing this bug for that reason. But we should definitely fix any unit tests or features that incorrectly assume things about the list order. It looks like the only known case of that is the CSS Quick Edit unit tests -- which I think actually boils down to the CSS Quick Edit feature itself. I'm planning to address that as part of #8830, so that one is already tracked. If you find other cases of bad assumptions being made about this API, please feel free to file bugs on those cases. |
Nice, the tests are indeed fixed. |
When I investigated https://groups.google.com/d/msg/brackets-dev/sLouD1zl6Nk/4jQ6-ErFo2cJ (Linux-only issue), I found out that
ProjectManager.getAllFiles()
(probably evenFileSystemEntry.visit()
) has no consistent sort order between operating systems.Most times, that's not much of an issue, but apparently CSSInlineEditor (and its tests) assumes there's a specific order.
Example:
Calling
getAllFiles()
onsrc/test/spec/CSSInlineEdit-test-files/css/
results in["test.css", "test2.css"]
on Win, but["test2.css", "test.css"]
on Ubuntu.cc @ingorichter
The text was updated successfully, but these errors were encountered: