func tests: "I! Starting Telegraf" isn't reliable to detect the last restart in logs
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Telegraf Charm |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
In the compute functional tests, we rely on "I! Starting Telegraf" to discard logs priori to the last restart.
But Telegraf doesn't always log it. I found that the only reliable log line was "I! Loaded inputs:".
We should determine if this is a bug in telegraf itself (in which case, we'll file a bug upstream), or if it's intended in which case we should:
--- a/src/tests/
+++ b/src/tests/
@@ -42,7 +42,7 @@ class TestTelegrafCom
)
# Sometimes, the logs show errors on Telegraf first start because br-int isn't
# yet started. To overcome this, just check the most recent start of Telegraf.
- up_to_word = "I! Starting Telegraf"
+ up_to_word = "I! Loaded inputs:"
rx_to_last = r"^.*{}
last_logs = re.sub(rx_to_last, "", content, flags=re.
The root cause is (imho) a but in telegraf upstream, so I filed: /github. com/influxdata/ telegraf/ issues/ 9120
https:/
Until a fix is released, we should handle this case in the test suite though.