-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Polish gnu tests #1766
Polish gnu tests #1766
Conversation
.github/workflows/GNU.yml
Outdated
@@ -83,7 +104,7 @@ jobs: | |||
GNULIB_DIR="${PWD}/gnulib" | |||
pushd gnu | |||
|
|||
unbuffer timeout -sKILL 3600 make -j "$(nproc)" check SUBDIRS=. RUN_EXPENSIVE_TESTS=yes RUN_VERY_EXPENSIVE_TESTS=yes VERBOSE=no || : | |||
timeout -sKILL 4h make -j "$(nproc)" check SUBDIRS=. RUN_EXPENSIVE_TESTS=yes RUN_VERY_EXPENSIVE_TESTS=yes VERBOSE=no || : # Kill after 4 hours in case something gets stuck in make |
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.
4h ? :)
1h seems enough, no ?
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.
not really, run time for the 'Run GNU tests' stage was 1 hour 9 minutes on the last commit before I opened the PR (adding some shorter timeouts on a few more tests known to hang could speed things up a bit). I'm not worried about making this as sort as possible, with the timeout being applied per-test this was just left as a last resort in case something in make gets jammed.
It turns out there's a built in 6 hour limit on github actions, so we could also take this out and rely on that if something does get break.
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.
Maybe 2 hours then. Also, expect
can now be removed from the apt-get install
line above, since you are removing the unbuffer
command.
@tdulcet what do you think of these changes? There are some tests that currently fail due to differences in the exact wording of error messages, which I'm not sure what to do with. They shouldn't be removed because they include tests on behaviour that must be kept, but editing the messages being checked against might be a lot of work to keep up to date as people change the code. |
With this patch, we are at |
Those are probably the tests that were running on utils that aren't built in this repo, those would have been using the system util before and passing. Let me just review the changes to confirm that is what's happened. |
I found 2 tests that were failing because they were using utils that aren't built so they were using false. There's also some problem with the stty tests, which now complain they don't have controlling tty, I need to investigate what's up with that. |
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.
@tdulcet what do you think of these changes?
Your changes look good. Thanks for doing this! I just have some minor feedback.
.github/workflows/GNU.yml
Outdated
for binary in $(./build-aux/gen-lists-of-programs.sh --list-progs) | ||
do | ||
bin_path="${BUILDDIR}/${binary}" | ||
test -f "${bin_path}" || cp "${BUILDDIR}/false" "${bin_path}" |
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.
Maybe output the names of all binaries that are not currently built for reference. Something like this:
test -f "${bin_path}" || { echo "'${binary}' was not built with uutils, using the 'false' program"; cp "${BUILDDIR}/false" "${bin_path}"; }
.github/workflows/GNU.yml
Outdated
# Change the PATH in the Makefile to test the uutils coreutils instead of the GNU coreutils | ||
sed -i "s/^[[:blank:]]*PATH=.*/ PATH='${BUILDDIR//\//\\/}\$(PATH_SEPARATOR)'\"\$\$PATH\" \\\/" Makefile | ||
sed -i 's| tr | /usr/bin/tr |' tests/init.sh | ||
make | ||
# Generate the factor tests, so they can be fixed | ||
for i in $(seq -w 1 36) | ||
for i in $(seq -w 0 36) |
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.
This can be done in Bash without seq
:
for i in {00..36}
.github/workflows/GNU.yml
Outdated
sed -i -e "s|stat|$(which stat)|" tests/chgrp/basic.sh tests/cp/existing-perm-dir.sh tests/touch/60-seconds.sh tests/misc/sort-compress-proc.sh tests/touch/60-seconds.sh | ||
sed -i -e "s|ls -|$(which ls) -|" tests/chgrp/posix-H.sh tests/chown/deref.sh tests/cp/same-file.sh tests/misc/mknod.sh tests/mv/part-symlink.sh | ||
sed -i -e "s|mkdir |$(which mkdir) |" tests/cp/existing-perm-dir.sh tests/rm/empty-inacc.sh | ||
sed -i -e "s|timeout |$(which timeout) |" tests/cp/parent-perm-race.sh tests/ls/infloop.sh tests/misc/sort-exit-early.sh tests/misc/sort-NaN-infloop.sh tests/misc/uniq-perf.sh tests/tail-2/inotify-only-regular.sh tests/tail-2/pipe-f2.sh tests/tail-2/retry.sh tests/tail-2/symlink.sh tests/tail-2/wait.sh tests/tail-2/pid.sh tests/dd/stats.sh | ||
sed -i -e "s| timeout | $(which timeout) |" tests/tail-2/inotify-rotate.sh # Don't break the function called 'grep_timeout' | ||
sed -i -e "s|chmod |$(which chmod) |" tests/du/inacc-dir.sh tests/mkdir/p-3.sh | ||
sed -i -e "s|sort |$(which sort) |" tests/ls/hyperlink.sh tests/misc/test-N.sh | ||
sed -i -e "s|split |$(which split) |" tests/misc/factor-parallel.sh | ||
sed -i -e "s|truncate |$(which truncate) |" tests/split/fail.sh | ||
|
||
#Add specific timeout to tests that currently hang to limit time spent waiting | ||
sed -i -e "s|seq \\$|$(which timeout) 0.1 seq \$|" tests/misc/seq-precision.sh tests/misc/seq-long-double.sh | ||
sed -i -e "s|cat |$(which timeout) 0.1 cat |" tests/misc/cat-self.sh |
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.
The -e
flags are not needed here. The which
commands are also not needed, since the GNU coreutils should always be in /usr/bin/
.
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.
There was some problem with commands not being found which is why I started using which
, though that might have been a typo so I'll have another try.
.github/workflows/GNU.yml
Outdated
@@ -83,7 +104,7 @@ jobs: | |||
GNULIB_DIR="${PWD}/gnulib" | |||
pushd gnu | |||
|
|||
unbuffer timeout -sKILL 3600 make -j "$(nproc)" check SUBDIRS=. RUN_EXPENSIVE_TESTS=yes RUN_VERY_EXPENSIVE_TESTS=yes VERBOSE=no || : | |||
timeout -sKILL 4h make -j "$(nproc)" check SUBDIRS=. RUN_EXPENSIVE_TESTS=yes RUN_VERY_EXPENSIVE_TESTS=yes VERBOSE=no || : # Kill after 4 hours in case something gets stuck in make |
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.
Maybe 2 hours then. Also, expect
can now be removed from the apt-get install
line above, since you are removing the unbuffer
command.
@@ -83,7 +104,7 @@ jobs: | |||
GNULIB_DIR="${PWD}/gnulib" |
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.
This and the above variable is not used. Same with SKIP
and XPASS
variables below.
.github/workflows/GNU.yml
Outdated
@@ -38,42 +38,63 @@ jobs: | |||
pushd uutils | |||
make PROFILE=release | |||
BUILDDIR="$PWD/target/release/" | |||
cp ${BUILDDIR}/install ${BUILDDIR}/ginstall # The GNU tests rename this script before running, to avoid confusion with the make target |
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.
${BUILDDIR}
should be quoted in case the path contains spaces.
The log is huge (207m), would it be possible to trim some of the content ?
|
Yeah, sorry for the delay on that. I should have time this weekend to finish cleaning it up. It’s in a pretty decent state already, so I don’t think it’ll take very long to do so. |
Can we log the GNU tests to flat shell scripts to decouple them from the Perl like the AWK test suite? https://blog.janestreet.com/testing-with-expectations/ https://www.cs.princeton.edu/courses/archive/spring01/cs333/awktest.html |
Large logs should be compressed by default. Personal preference for zstd because you can give it a dictionary to reduce the size even more. |
The idea here is to run the GNU tests so we can compare the current implementation to the GNU implementation, so we want to be taking their tests directly so that this is kept up to date with the current behaviour of the GNU coreutils. This is why the tests are taken from a current checkout of the GNU repo, and means we should be looking to make the fewest changes necessary to make sure they run correctly. Converting tests from Perl to shell scripts would require us to copy the tests into this repo and then try to maintain them ourselves. I do not think that is something that should be done. Further, even if we were to decide to maintain our own fork of the GNU tests I don't see what benefit converting existing tests from Perl to shell would provide.
Github will be compressing the archive on their backend (I assume, it'd be the only way to keep storage manageable) so I'm not sure adding our own compression would help. Further it'd mean anyone attempting to access the archive will now need to deal with 2 layers of compression (the zst on individual files plus the zip you download the archive as). The best solution is to fix the bug that is causing |
@jaggededgedjustice can it be merged? |
I think this can be merged now, I'm just going to do a final review of the results after the latest changes. |
@jaggededgedjustice looks good to me :) |
@jaggededgedjustice can it be merged? It is green |
ok, this is good to go. |
The GNU tests are failing with this error:
before they finish and output the results, which is why "Extract test info" step is failing and 4352d47 was necessary. |
@tdulcet see #1842 (comment) from @nbraud |
Issue #1879 is the root cause of the failure in gawk. |
Though following on from the comment on the other PR, would it be better to have the GNU tests run on a cron rather than every PR? It's mostly an informational resource at the moment and isn't useful for deciding if a PR is good to merge as basically everything is failing. |
This Makes some improvements to the gnu tests:
timeout
to each test so we do not need to remove any test that hangshashsum
to create the*sum
binaries so they can be testedfalse
to it so that the relevant tests will failunbuffer
from the test run as it was causing hangs that even the toptimeout
didn't kill and it didn't offer noticeable benefit