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

Update runtests to test for shared memory segments #3308

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

BsAtHome
Copy link
Contributor

There are cases where shared memory segments are left in existence. Either by crashes or other problems. This PR checks the existence of them by key and refuses to start the tests if detected. When tests are underway, runtests will warn and remove segments after a test is completed so that the next tests is not influenced by the previous.

Notably motion-logger fails to cleanup shared memory. This should be fixed separately.

The PR also updates to remove shellcheck problems (mostly double quotes).

Update to remove shellcheck problems (mostly double quotes).
@andypugh
Copy link
Collaborator

andypugh commented Feb 1, 2025

Your commit comment mentions shellcheck. Is this commit dependent on previous shellcheck-related ones?

@BsAtHome
Copy link
Contributor Author

BsAtHome commented Feb 1, 2025

Is this commit dependent on previous shellcheck-related ones?

All commits and PRs are independent, but all include fixes as indicated by shellcheck.

This PR in particular adds a check for left-over shared memory segments. It also fixes the necessary double quotes and few other shellcheck indicated fixes. I separated the PR because this adds/changes functionality.

scripts/runtests.in Outdated Show resolved Hide resolved
done
done
echo
echo "You should remove the key(s) with 'ipcrm -M <key>' if LinuxCNC is"
Copy link
Collaborator

Choose a reason for hiding this comment

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

Would it be appropriate to add this to what halrun -U does?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Halrun takes care of hal items. Only one of the shared mem keys is from hal.

That said, the point of the check you address here (function test_shmem()) is to show to the person trying to run the tests that something has not gone through cleanup on a previous run. This function is called before any tests are executed and just protects you from starting tests in a bad environment (this has bit my many times). The runtests script exits if keys are found so you can do your own investigation.

It is easier to do cleanups once tests are underway and in-between each test is a checkpoint to see if there are leftovers and can be dealt with (function test_and_remove_shmem()).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants