Fix errors in the CI pipeline introduced by ns-3.41 #158
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The upgrade to ns-3.41 caused the CI pipeline to start failing. In particular, the
PhyConnectivityTest
case was not passing anymore when the module was compiled with g++ indefault
mode (strangely enough the same test was passing whenccache
was not used, or withccache
but compiling inoptimized
mode).The failing assertion was tracked down to be on the function
HaveSamePacketContents
, which compared the serialized contents of twoPacket
objects byte by byte. I suppose that the error is caused by some internal optimization done by ns-3, because the two packets have the same unique identifier. The unique identifier seems to be the correct way to check whether twoPacket
objects are the same, so the function was changed accordingly and the test started working correctly again.This PR also includes the second enhancement to the build and test task that I was not able to implement in the past. Up to now, tests were skipped if
ccache
resulted in 0 cache misses after the build phase. This meant that the CI pipeline could fail once due to the tests failing, but it could be rerun just after, reuse the cache, skip the tests and give a false positive on the same code.As done in the GitLab CI pipeline of ns-3, we now use a cached empty file to track successful tests. This placeholder file is created when compilation happens with >0 cache misses, it is always downloaded before tests and only deleted if the tests are successful. Thus, now tests are only skipped if they have been already executed successfully on a codebase state fully present in the cache.