-
Notifications
You must be signed in to change notification settings - Fork 4.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Modify ErrorHandlingTests for browser #40659
Modify ErrorHandlingTests for browser #40659
Conversation
I couldn't figure out the best area label to add to this PR. If you have write-permissions please help me learn by adding exactly one area label. |
0bb9bea
to
3d2d6b0
Compare
45e4b25
to
a8cc3f7
Compare
a8cc3f7
to
ad2f5a9
Compare
{ | ||
DirectoryInfo testDirectory = Directory.CreateDirectory(GetTestFilePath()); | ||
var names = new List<string>(); | ||
var lengthCap = PlatformDetection.IsBrowser ? 256 : 10_000; // On Browser NAME_MAX is 255, otherwise arbitrarily large limit for the test |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So, in memfs, there is no enforcement of NAME_MAX
, which is 255. As a result, you'll get 9999 files, 255 of which have increasing "a" names and the rest get their names truncated.
I'm not sure if this test has much value.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As in the test should be removed all together? If its any worth testing enumerability, changing the length upper limit still allows for that.
These library tests are failing because emscripten does not throw an exception when truncating filenames longer than 255 characters. When emscripten begins to properly throw an exception, this change can be removed. |
Fixes #40531
Emscripten, using musl libc, sets
NAME_MAX
to 255https://github.com/emscripten-core/emscripten/blob/master/system/include/libc/limits.h
https://git.musl-libc.org/cgit/musl/tree/include/limits.h#n47
Running tests before changes
Tests run: 3903, Errors: 0, Failures: 0, Skipped: 117. Time: 10.217902s
Running tests after changes
Tests run: 3905, Errors: 0, Failures: 0, Skipped: 117. Time: 10.4601469s