Closed ubgk closed 1 year ago
I know it's a hard problem to tell without being able to reproduce on your system. I'll try to see if I can write a short contrived example using shm_open
and write
to reproduce the error elsewhere.
We can probably fix the first error from the log easily:
[2023-05-22 15:36:48.084] [error] Cannot open shared memory "tester": file already exists. Is the spine already running? Did it not exit properly? If not, run ``bazel run @vulp//tools/shm:clean -- tester``
This may occur because the tests run in separate threads, but the fixture opens a file named "tester" in shared memory:
void SetUp() override {
agent_interface_ = std::make_unique<AgentInterface>("tester", 1024);
}
We can work around that with a random_string()
like in the other test fixtures.
Done, that error is fixed by https://github.com/tasts-robots/vulp/pull/15/commits/fe5f59981f6c64282e54d9386e9c20307f131ed0
Python tests are also fixed by https://github.com/tasts-robots/vulp/pull/15/commits/f7ff0ebbeb47340e44a1f0559cf009a69c93c4ea which closes the memory map and unlinks the shared memory after each test to prevent setUp from trying to create a new shared memory file with the same name before each test. Does that look OK to you? @stephane-caron
If it makes sense, it should also be possible to make sure setUp runs only once for the entire class, but I haven't looked at it.
LGTM. You will need to clang-format some files like:
ERROR: actuation/Interface.cpp needs clang-format
so that we see if the tests pass. If all tests pass then it's good to go :ok_hand:
Closing this issue as fixed by https://github.com/tasts-robots/vulp/pull/30 (we forgot to mark it in the PR).
Feel free to open another issue for the next macOS error.
SetUp()
inSpineTest.cpp
(#15) fails due toENXIO
(errno 6) thrown byAgentInterface.cpp:allocate_file
, which means (according to the man entry):As
AgentInterface
constructor checks for errors aftershm_open
, what do you think could cause the write to fail? @stephane-caronYou can see the logs here: error.log