-
Notifications
You must be signed in to change notification settings - Fork 152
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
Tweak to the -s argument and the log message to match #1427
Conversation
@krader1961 I attempted to validate this fix in Debian and the test appears to be still failing. I issued a separate PR on test failures due to missing home directory, and I'm just wondering whether this and b_hist.exp test failures that I'm experiencing could also be related to that. I'll keep digging a little further. Build log: https://salsa.debian.org/debian/ksh/-/jobs/396918 SHELL='/builds/debian/ksh/debian/output/ksh-2020.0.0/obj-x86_64-linux-gnu/src/cmd/ksh93/ksh' LIBSAMPLE_PATH='/builds/debian/ksh/debian/output/ksh-2020.0.0/obj-x86_64-linux-gnu/src/lib/libdll/libsample.so' TEST_ROOT='/builds/debian/ksh/debian/output/ksh-2020.0.0/src/cmd/ksh93/tests' LD_LIBRARY_PATH='/builds/debian/ksh/debian/output/ksh-2020.0.0/obj-x86_64-linux-gnu/src/lib/libast:/builds/debian/ksh/debian/output/ksh-2020.0.0/obj-x86_64-linux-gnu/src/lib/libcmd:/builds/debian/ksh/debian/output/ksh-2020.0.0/obj-x86_64-linux-gnu/src/lib/libdll' SRC_ROOT='/builds/debian/ksh/debian/output/ksh-2020.0.0' SHCOMP='/builds/debian/ksh/debian/output/ksh-2020.0.0/obj-x86_64-linux-gnu/src/cmd/ksh93/shcomp' LANG='en_US.UTF-8' /builds/debian/ksh/debian/output/ksh-2020.0.0/obj-x86_64-linux-gnu/src/cmd/ksh93/ksh /builds/debian/ksh/debian/output/ksh-2020.0.0/src/cmd/ksh93/tests/util/run_test.sh shcomp b_sync |
src/cmd/ksh93/tests/b_sync.sh
Outdated
@@ -23,9 +23,9 @@ expect="" | |||
# | |||
# We don't use fd 3 because it might be opened by a debug malloc subsystem. We expect fd 999 to be | |||
# unused if not invalid. | |||
actual=$(sync -s 999 2>&1) | |||
actual=$(sync -s999 2>&1) |
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.
If the removal of the space between the short option and its value changes the behavior that means getopt_long()
, or its use by b_sync()
, is seriously broken. That is unlikely given that it works correctly on quite a few platforms. What is more likely is there is something odd about your test environment. Perhaps your virtual-machine or other sandbox behavior that makes fsync(999)
seem to succeed when it should fail.
P.S., the log_error()
portion of your change is correct; albeit solely to avoid confusion for a human reader of 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.
I agree the space between the -s and 999 doesn't have any impact, just thought I'd make it consistent with the prior test. I only wanted to update the log message as it confused me initially while reviewing the output.
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.
It is actually a net positive that tests vary such seemingly trivial details as the spacing between options and their value. Attempting 100% consistency on such points, that are otherwise irrelevant to the real purpose of the test, is counter-productive. Such inconsistencies help to find bugs and help ensure readers of the code do not make unwarranted assumptions.
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.
It has been reverted...
You'll probably need to use strace and lsof to understand what's going on. |
Yeah, the trouble is that I'm not able to recreate this locally. I agree strace would help understand what's going on. Will poke around a bit more, learning ksh and how you guys have laid things out along the way. Impressive. |
Honestly, my recommendation is to just blacklist this test. See ast/src/cmd/ksh93/tests/util/run_test.sh Lines 20 to 40 in 11983a7
And ast/src/cmd/ksh93/tests/util/run_test.sh Lines 109 to 120 in 11983a7
Although I would predicate skipping it on running inside a Salsa CI context, rather than the platform being Debian, if that is possible. |
@aweeraman I've merged this. As I said earlier you might want to consider just blacklisting the |
Will do, thanks. |
Small tweak to the recent fix for the b_sync test.