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

Fix errors in the CI pipeline introduced by ns-3.41 #158

Merged
merged 1 commit into from
Mar 22, 2024

Conversation

non-det-alle
Copy link
Collaborator

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++ in default mode (strangely enough the same test was passing when ccache was not used, or with ccache but compiling in optimized mode).

The failing assertion was tracked down to be on the function HaveSamePacketContents, which compared the serialized contents of two Packet 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 two Packet 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.

+ CI: only skip tests if they were successful on a past run with same ccache contents
+ Tests: compare packets with uid instead of each serialized byte
@non-det-alle non-det-alle self-assigned this Mar 22, 2024
Copy link

codecov bot commented Mar 22, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 76.23%. Comparing base (69cb2e3) to head (15c4c4e).

Additional details and impacted files
@@             Coverage Diff             @@
##           develop     #158      +/-   ##
===========================================
- Coverage    76.27%   76.23%   -0.05%     
===========================================
  Files           69       69              
  Lines         5451     5441      -10     
===========================================
- Hits          4158     4148      -10     
  Misses        1293     1293              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@non-det-alle non-det-alle merged commit 7c0ca67 into develop Mar 22, 2024
20 of 21 checks passed
@non-det-alle non-det-alle deleted the fix-ns-3.41-ci branch March 22, 2024 11:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant