Repository navigation
Commit 5e2509a
authored
[test] Add tests for cmd.shutdownTracingProviderWithTimeout (#14556)
# Test Coverage Improvement: shutdownTracingProviderWithTimeout
## Function Analyzed
- **Package**: `internal/cmd`
- **Function**: `shutdownTracingProviderWithTimeout`
- **Previous Coverage**: 71.4%
- **New Coverage**: 100%
- **Complexity**: Low-Medium (timeout context + error branch)
## Why This Function?
Overall coverage is already high. This was among the few remaining
partially covered non-trivial functions, and its shutdown-error branch
(warning callback) was never exercised.
## Tests Added
- ✅ SDK provider shutdown against a collector that hangs on export, so
the 5s shutdown timeout fires and the `warnf` error path is verified
(exactly one warning, expected message)
- Skipped under `-short` since it waits for the 5s timeout
## Test Execution
```
--- PASS: TestShutdownTracingProviderWithTimeout (5.00s)
tracing.go:95: shutdownTracingProviderWithTimeout 100.0%
```
---
*Generated by Test Coverage Improver*
> [!WARNING]
> <details>
> <summary>Firewall blocked 4 domains</summary>
>
> The following domains were blocked by the firewall during workflow
execution:
>
> - `example.com`
> - `nonexistent.local`
> - `slow.example.com`
> - `thishostdoesnotexist12345.com`
>
> To allow these domains, add them to the `network.allowed` list in your
workflow frontmatter:
>
> ```yaml
> network:
> allowed:
> - defaults
> - "example.com"
> - "nonexistent.local"
> - "slow.example.com"
> - "thishostdoesnotexist12345.com"
> ```
>
> See [Network
Configuration](https://github.github.com/gh-aw/reference/network/) for
more information.
>
> </details>
> Generated by [Test Coverage
Improver](https://github.com/github/gh-aw-mcpg/actions/runs/37653372714)
· copilot · auto · 60.2 AIC · ⊞ 10.6K ·
[◷](https://github.com/search?q=repo%3Agithub%2Fgh-aw-mcpg+%22gh-aw-workflow-id%3A+test-coverage-improver%22&type=pullrequests)
<!-- gh-aw-agentic-workflow: Test Coverage Improver, engine: copilot,
model: auto, id: 37653372714, workflow_id: test-coverage-improver, run:
https://github.com/github/gh-aw-mcpg/actions/runs/37653372714 -->
<!-- gh-aw-workflow-id: test-coverage-improver -->
<!-- gh-aw-workflow-call-id: github/gh-aw-mcpg/test-coverage-improver
-->1 file changed
Lines changed: 35 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
5 | 8 | | |
6 | 9 | | |
7 | 10 | | |
| |||
187 | 190 | | |
188 | 191 | | |
189 | 192 | | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
190 | 225 | | |
191 | 226 | | |
192 | 227 | | |
| |||
0 commit comments