Skip to content
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

Reduce test time on TravisCI #2757

Merged
merged 5 commits into from
Aug 31, 2021
Merged

Reduce test time on TravisCI #2757

merged 5 commits into from
Aug 31, 2021

Conversation

Cyan4973
Copy link
Contributor

@Cyan4973 Cyan4973 commented Aug 29, 2021

Well, this was initially an attempt at transferring more tests from TravisCI into Github Actions.
But with additional complexities along the way, I decided to cut down the scope of this PR at just making TravisCI tests shorter.
More test transfers will happen in other PR(s).

  • Remove 1 long test (~30 mn) which was already run on GA (minimal decompression macros)
  • Reduce 1 long test delay (~27 mn), by refining its scope (static analyzer)
  • Reduce 1 medium test delay (~13 mn), thank to more appropriate parameters (versions compatibility test)
  • Remove qemu tests, transferred to Github Actions in added qemu tests #2758

This reduces cpu time spent on TravisCI by ~90mn per tested commit (from 2h35mn to 1h05mn).

by allowing parallel build of units,
and reducing optimization levels.

Parallel build is only effective on "recent" versions of `zstd`,
as previously, the list of units was passed as a list of source files,
which is something neither `make` nor `gcc` can parallelize.
So its impact is mildly effective (-20%).

Reducing optimization level to `-O1` makes compilation much faster.
It also makes runtime slower,
but in this test, compilation time dominates run time.
The savings are very significant (-50%).

On my test system, it reduces the length of this test from 13mn to 5mn.
This was ~30mn, by far the longest run on travisCI.
That's because it re-analyzes multiple times the same files (library files notably).
It also performs actions that make no sense for the static analyzer purpose,
such as building the single-file library.

Reduced time spent in this test by reducing its scope :
just build the CLI, and obviously the library along it.
These are the only ones that really deserve to be analyzed.

Unfortunately, it still results in a number of false positives when using newer versions of scanbuild
(each version of scanbuild generates a different list of false positives).
These will have to be fixed before transfering to Github Actions.
@Cyan4973 Cyan4973 changed the title Transfering more tests to Github Actions Reduce test time on TravisCI Aug 29, 2021
since it fails on Github Actions specifically.

The test is run on TravisCI for the time being.
Its duration has been reduced to ~6mn anyway.
@Cyan4973
Copy link
Contributor Author

Cyan4973 commented Aug 30, 2021

Note : the flaky failing test is unrelated to this PR :
https://app.travis-ci.com/github/facebook/zstd/jobs/534442763

./decodecorpus -t -T1mn
seed: 57315
3216           *** stack smashing detected ***: <unknown> terminated
make: *** [test-decodecorpus] Aborted (core dumped)
Makefile:359: recipe for target 'test-decodecorpus' failed

There seems to be an issue in decodecorpus, maybe it consumes more stack space than it should.

This test has been failing for a while now, but because the issue is transient, and apparently specific to s390x, it hasn't attracted attention when it started happening.
Would be worth an investigation though.

that are being transfered to GA in #2758.
This represents a saving of ~25mn of cpu time on TravisCI.
@@ -200,6 +200,18 @@ jobs:
make clean && make -j all MOREFLAGS="-Werror -DZSTD_NO_INLINE -DZSTD_STRIP_ERROR_STRINGS"
make clean && make check MOREFLAGS="-Werror -DZSTD_NO_INLINE -DZSTD_STRIP_ERROR_STRINGS"

# This test currently fails on Github Actions specifically.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is probably because GH Actions runners are not ttys. I believe there is a third-party GH action that creates a tty now, so I can go back and migrate the tests that were failing because it wasn't a tty at some point.

@Cyan4973 Cyan4973 merged commit 6933ac6 into dev Aug 31, 2021
@Cyan4973 Cyan4973 deleted the transferGA branch December 9, 2021 00:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants