akiomik / akiomik/bela-rs

monitoring_rules reads any Error::Init as its own setup abort

未关闭
#168 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
bug hardware
主要语言
Rust
星标
1
派生
0
平均合并
5 小时 19 分钟
30 天内合并 PR
26

描述

`bela/examples/monitoring_rules.rs` treats `Error::Init(_)` as proof
that its own `setup` abort happened:

```rust
// `Observe` aborts in `setup`, so a failed init is the expected
// outcome and means the observation was taken.
let observed = match Bela::new(app, &settings) {
Err(Error::Init(_)) => true,
```

and again in `poisoned()`, where `Err(Error::Init(_)) => "failed"` is
what the row asserts the poisoning from.

#166 establishes a second way to get `Error::Init`, before `setup` is
ever called: libbela refuses at the door with `-1` when another process
holds the board. Run the example while anything holds it — a leftover
probe, a project on a board that autoruns one — and `monitoring()`
reports `monitoring=none` as a positive claim that the counters were
off, having observed nothing at all; `poisoned()` reports
`first-init=failed poisoned-new=refused` as if it had demonstrated the
poisoning it exists to assert.

`bela/examples/init_failure.rs` was corrected for exactly this shape in
#166. This one was not, and it is the example `scripts/smoke-test.sh`
drives, so a false row there reads as a passing check.

The distinguishing information is in the error: `-1` is the refusal,
and a `setup` abort is `1`. Reporting the code, or matching on it, would
close it. Note the smoke test matches the exact string
`first-init=failed poisoned-new=refused` (`scripts/smoke-test.sh:818`)
and parses `rules: monitoring=`, so whatever is done has to leave the
contended case falling outside those rather than silently inside them.

贡献指南

打开贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。