Skip to content

Conversation

@jimklimov
Copy link
Member

@jimklimov jimklimov commented Oct 18, 2023

This PR started as an investigation into occasional NIT (NUT Integration Test) script failures, and so far stumbled on a number of imperfections in the dummy-ups driver - so started with those.

Updated with NIT test-script fixes as well.

NOTE: Strange behavior noted on WSL2 Ubuntu builds (maybe the VM is just slow now) that both upsd and dummy-ups daemons logged stuff in bursts separated by roughly 10 sec, and those logs took a while to appear on display. There seemed to be a considerable delay between driver start, and readiness, and socket creation, and upsd connection to that socket, and DUMPALL request, and lots of info streaming until DUMPDONE marker - took about a minute overall for that test case initialization, and almost 3 min for the script. On other systems it goes at 1 sec cadence and all test cases complete in 20 sec.

UPDATE: Yeah, a laggy VM, huge load average with no real CPU load - nothing a wsl --shutdown could not fix.

To make sense of that wall of text, added NUT_DEBUG_PID optional envvar support to OPTIONALLY log with non-zero debug level and PIDs, like:

[D5:21086] send_to_all: SETINFO driver.state "cleanup.exit"

instead of plain

[D5] send_to_all: SETINFO driver.state "cleanup.exit"

This allows NIT mixed log from 4 daemons to be better understandable (adding a name might be better?) and I suppose can help systems that run all NUT programs as one logged bundle - e.g. containers like HA plugins - without a syslog/journal that would add identifiers to each line.

Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
…based dummy-ups; check for invalid FD for good measure (to avoid fstat() on that)

Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
…y short "device_path" to stat the paths

Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
@jimklimov jimklimov added enhancement CI Entries related to continuous integration infrastructure (here CI = tools + scripts + recipes) labels Oct 18, 2023
@jimklimov jimklimov added this to the 2.8.1 milestone Oct 18, 2023
Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
…x_start_drivers() if debugging

Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
…imeout and explain why

Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
…tching expression and explain why

Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
…to help log readability

Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
…include PID number in debug-level identifiers

Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
@jimklimov jimklimov changed the title Clean up dummy-ups code, behavior and logs Clean up dummy-ups code, behavior and logs; added NUT_DEBUG_PID option Oct 18, 2023
@AppVeyorBot
Copy link

… in testgroup*()

Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
…; revise upsd stopping after testcase_upsd_allow_no_device()

Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
* report why a test case failed sanity-checks;
* avoid grep output spilling to test log to avoid confusion;
* revise that exactly expected port count was seen (that was the confusion);
* use log_*() in that sanity-check block

Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
@AppVeyorBot
Copy link

This confuses CI log analyzer

Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
@jimklimov jimklimov merged commit ff24189 into networkupstools:master Oct 19, 2023
@jimklimov jimklimov deleted the nit-warn branch October 19, 2023 21:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CI Entries related to continuous integration infrastructure (here CI = tools + scripts + recipes) enhancement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants