action #96519
Updated by livdywan over 3 years ago
## Observation
It seems we were just there to have stable coverage but now we have seen flaky coverage in other places again, e.g. in https://github.com/os-autoinst/openQA/pull/4103 mentions `lib/OpenQA/Scheduler.pm 98.14% <0.00%> (-1.86%)`. I suspect one of
* https://github.com/os-autoinst/openQA/pull/4072
* https://github.com/os-autoinst/openQA/pull/4095
* https://github.com/os-autoinst/openQA/pull/4096
# Acceptance criteria
- **AC1**: Stable 100% coverage for lib/OpenQA/Scheduler.pm
# Suggestion
- Mark offending code as not coverable e.g. `# uncoverable statement`
- Trigger manual coverage collection in the `sub`
- Look into https://app.codecov.io/gh/os-autoinst/openQA/compare/4103/changes
```perl
# check for stale jobs every 2 minutes
Mojo::IOLoop->recurring(
120 => sub {
OpenQA::Scheduler::Model::Jobs->singleton->incomplete_and_duplicate_stale_jobs;
});
```