Open troglobit opened 1 year ago
I think that test_restconf_internal.sh suffers from some quality problems, ie the test itself, it was somewhat problematic writing it because of timing and multile processes. Thank you for your effort.
No worries. Do you want us to look into the shutting down of clixon_restconf when the backend receives SIGTERM?
The "internal" restconf is one of three ways to start the restconf daemon, as described here: https://clixon-docs.readthedocs.io/en/latest/restconf.html#datastore ie by forking from the backend. it is probably not the most common scenario (such as starting the restconf daemon separately) but there are products using this method. test_restconf_internal.sh tests this. But as you point out there are some issues. If you want you are welcome to debug this, at least the symtom: what more specifically is wrong, and how to repeat it deterministically. There is some docs here on starting sub-processes.
Alright, we'll look into it. I'll keep you posted, cheers!
While debugging issues with running the regression tests in PR #418, we noticed that
test_restconf_internal.sh
often failed, and always at the same step:We've reproduced this on three different machines, all running a Ubuntu 18.04 or 22.04 derivative, despite the tests running in an Alpine Linux docker container. (On an old Fedora 33 server, however, all tests pass ... unclear why, but worth mentioning for reference.)
Turns out that at the end of step
"11. Get restconf status rpc"
, whenstop_backend -f $cfg
is called, theclixon_backend -z -f $cfg
does not stop theclixon_restconf
child. So in step"12. Get restconf (running) after restart"
therpcstatus
call fails.Adding a
killall
"fixes" the problem:Obviously this is not the proper fix. Question is why
clixon_backend
doesn't kill the child it started, or why a newclixon_backend
cannot reconnect with an already runningclixon_restconf
process? I'm not up to speed how that dynamic works, but maybe someone else in the wider Clixon community do.There were a few other warnings as well, for instance the "stray \ before -" grep warning. This seems to just be a minor regexp mistake (- not needed outside of regexp ranges):
Compared to the Fedora machine we also noticed that restoring the tty with stty also gives some noise. Here's a lib.sh patch:
Finally, in lib.sh, there's an additional pkill that seems a bit malplaced: