Agent skill · Audited from source
Fix Random Ci Test Failure
skill · dotnet/maciosNOASSERTION licenceAudited 7 Oct 2026 · source bed039ebfded
Is it safe? Yes — SAFE, grade B (89/100). We read this skill's source at commit bed039ebfded and found no filesystem, network or shell access and no hard-coded secrets. What it does: Investigate and fix flaky/random CI test failures in dotnet/macios. Trigger on GitHub issues describing intermittent test failures, CI postmortem issues, or when asked to fix a flaky test. Analyzes test code, identifies…
Cite
Cite this page
ModelsAtlas. “Fix Random Ci Test Failure (dotnet/macios)”. Retrieved 7 Oct 2026. https://modelsatlas.com/skills/dotnet/fix-random-ci-test-failure
Trust audit
Audit 0.4.1 · source read 7 Oct 2026
SAFE means nothing in the source contradicts what the skill says it does. Grade B is shared by 17,406 of 18,389 audited skills.
What the source does
- FilesystemNone observedNo reads or writes in the source
- NetworkNone observedNo outbound calls in the source
- ShellNone observedNo commands run in the source
- DependenciesPinnedNothing floats
- SecretsNone foundNo keys in source
Five audit layers
| Layer | What we check | Result | Findings |
|---|---|---|---|
L0 Provenance | Repo owner, licence, archive status, activity | PASS | 0 |
L1 Static source | Secrets, path traversal, supply chain, hidden code | NA | 0 |
L2 Instructions | Prompt injection, authority framing, hidden directives | PASS | 1 |
L3 Inventory | The files and declarations match the source | PASS | 0 |
L4 Sandbox | Run in isolation and watch behaviour | SKIPPED why | 0 |
Gates applied: no behavioural pass.
Findings (1)
LOWPrompt injectionprompt.credential_read · tools/scripts/License.txt:32
SECTION II: XAMARIN STUDIO ENTERPRISE AND XAMARIN STUDIO PROFESSIONAL: When you acquire an active and valid subscription for either Microsoft Visual Studio Enterprise or Microsoft Visual Studio Profes
- Why
- asks the agent to read credentials
- Fix
- —
Audit 0.4.1 · source sha bed039ebfded · 7 Oct 2026Report an issue or request a re-scan
Provenance
Who published it, and what the verdict is pinned to
- Publisherdotnet GitHub organizationOwner of the repository this skill is read from
- Source folderdotnet/macios/.github/skills/fix-random-ci-test-failureThe exact folder we audited
- LicenceNOASSERTIONAs the repository states it
- Commit pinned for this verdictbed039ebfdedA new audit runs when the source changes
- Repository statusNot archivedPushed today
- Sandboxed runNot runSkills are read, not executed; layer L4 is skipped
What it tells the agent
Full source on GitHub ↗Its description: Investigate and fix flaky/random CI test failures in dotnet/macios. Trigger on GitHub issues describing intermittent test failures, CI postmortem issues, or when asked to fix a flaky test. Analyzes test code, identifies…
---
name: fix-random-ci-test-failure
description: >-
Investigate and fix flaky/random CI test failures in dotnet/macios. Trigger on
GitHub issues describing intermittent test failures, CI postmortem issues, or when
asked to fix a flaky test. Analyzes test code, identifies root causes
(shared state, environment dependencies, race conditions), and applies fixes.
---
# Fix Random CI Test Failure
Investigate and fix flaky CI test failures reported in GitHub issues for dotnet/macios.
## When to Use
- User shares a GitHub issue about a flaky/intermittent test failure
- Issue has the `ci-postmortem` label
- User asks to fix a randomly failing test
- Test failures appear across unrelated PRs (indicating environment-dependent flakiness)
## Workflow
### 1. Gather Failure Context
Read the GitHub issue to extract:
- **Test name** and **test suite** (e.g., monotouch-test)
- **Error message** and **assertion failure details**
- **Platform** (iOS, macOS, tvOS, Mac Catalyst)
- **Affected builds** — check if failures span unrelated PRs (confirms flakiness vs. regression)
If build URLs are provided, inspect logs for additional context (stack traces, timing info).
### 2. Locate and Analyze the Test
Find the test source file:
```
grep -r "TestMethodName" tests/
```
Read the **full test method** and all helper methods it calls. Understand:
- What external resources does it use? (keychain, file system, network, simulators)
- Does it use shared/hardcoded identifiers that could collide across parallel runs?
- Does it properly clean up before and after execution?
- Are there error paths that silently swallow failures?
### 3. Identify Root Cause Category
Common flaky test root causes in this repo:
#### Shared State / Resource Conflicts
- **Symptom**: Test uses hardcoded identifiers (e.g., fixed keychain entries, file paths, port numbers)
- **Fix**: Use process-unique identifiers (PID, GUID, bundle ID + test name)
- **Reference**: `tests/monotouch-test/Security/KeyChainTest.cs` uses per-process unique IDs
#### Environment-Dependent State
- **Symptom**: Test depends on OS-level state (keychain, permissions, network availability)
- **Fix**: Add robust setup/teardown, handle unexpected initial states, add retry logic for transient errors
#### Unhandled Error Codes
- **Symptom**: Code only handles expected success/failure codes, silently fails on unexpected ones
- **Fix**: Add fallback handling for unexpected status codes, log diagnostic info
#### Race Conditions / Timing
- **Symptom**: Test passes locally but fails intermittently in CI
- **Fix**: Add proper synchronization, increase timeouts, avoid timing-dependent assertions
#### LAContext / Authentication Issues (Security tests)
- **Symptom**: `InvalidRecord` or authentication-related errors on keychain operations
- **Fix**: Only attach `LAContext` where actually needed (not on plain query/delete operations)
### 4. Apply the Fix
When fixing:
1. **Prefer unique identifiers over shared ones.** Use `Process.GetCurrentProcess ().Id`, `Guid.NewGuid ()`, or `{bundleId}-{testType}-{pid}` patterns for resource identifiers.
2. **Create minimal query records.** For search/delete operations, don't attach unnecessary attributes (like `LAContext`) that can cause intermittent errors.
3. **Handle all status codes.** Never silently return `false` for unexpected error codes. Either handle them with a fallback path or fail with a descriptive assertion message.
4. **Add diagnostic logging.** Use `TestContext.Out.WriteLine` to log operation results that would help diagnose future failures.
5. **Clean up legacy state.** If renaming identifiers, also clean up entries from old names that may linger on CI agents.
6. **Always clean up in `finally` blocks.** Ensure test resources are released even on failure.
### 5. If the Fix is Unclear
If you cannot determine the root cause with available information:
1. **Add diagnostic logging** to capture operation results (status codes, error details) in future failures.
2. **Log the initial state** at test start (e.g., does the resource already exist before the test runs?).
3. **Include all relevant status codes** in assertion failure messages.
4. Explain to the user what additional information the logging will provide and what hypotheses it will help test.
### 6. Create the PR
- Branch naming: `dev/{username}/fix-{test-name}` or similar
- Commit message should explain all root causes addressed
- Reference the GitHub issue with `Fixes #NNNN` if the change actually fixes the problem, or `Ref #NNNN` if it only adds logging/diagnostics
- Add the `copilot` label to the PR
## Key Patterns in This Repo
- Keychain tests in `tests/monotouch-test/Security/` are particularly prone to flakiness due to shared macOS keychain state on CI agents
- `InitSecRecord` in `RecordTest.cs` attaches `LAContext` to all `SecRecord` instances — this is sometimes unnecessary and can cause `InvalidRecord` errors
- `KeyChainTest.cs` demonstrates the recommended pattern: per-process unique identifiers using bundle ID + test type + PID
- Tests run on shared CI agent machines where leftover state from previous runs can cause interferenceExcerpt, first 5,179 characters of SKILL.md, verbatim from the audited commit. It is text from someone else’s repository, quoted so you can judge it before your agent reads it.
Install
Pinned to the audited commit bed039e
git clone https://github.com/dotnet/macios git -C macios checkout bed039ebfded
The author documents no install command, so this uses the repository directly. Our verdict covers commit bed039ebfded only.
Works in which agents?
What its own text says, not a test
| Agent | Status | More |
|---|---|---|
| GitHub Copilot | Mentioned in its text, not tested | Skills for GitHub Copilot · About GitHub Copilot |
Audit history
Every audit, every source change
- ✓SAFE B 89 / 100
first audit · source
bed039ebfded
README badge
For maintainers · shows the latest audit
[](https://modelsatlas.com/skills/dotnet/fix-random-ci-test-failure/)
The badge shows our verdict and grade for this skill, and links back to this page. It changes when the audit does.
Similar skills
All coding & review skills →dotnet/macios
Create C# bindings for Apple frameworks in dotnet/macios. USE FOR: binding new APIs, implementing .todo file entries, creating Xcode SDK bindings, binding AVFoundation/UIKit/AppKit or any Apple framework, "bind this…
dotnet/macios
Investigate and triage CI failures for dotnet/macios from Azure DevOps build URLs. Use this skill whenever the user shares a DevOps build link, asks about CI failures, wants to understand why a build failed, or asks to…
dotnet/macios
Post-mortem analysis of CI failures across recent PRs in dotnet/macios. Identifies flaky tests, infrastructure issues, and shared regressions by analyzing builds from the last week. Files or updates GitHub issues for…
dotnet/macios
.NET for iOS, Mac Catalyst, macOS, and tvOS provide open-source bindings of the Apple SDKs for use with .NET managed languages such as C#
dotnet/macios
Update dotnet/macios to a new Xcode beta and validate it end-to-end. Use this skill when a user asks to bump Xcode beta versions, update macios SDK/version constants, run xtro-sharpie sanitization, and run introspection…
dotnet/macios
Download updated expected app size files from Azure DevOps CI artifacts for the current branch. Use when app size tests fail in CI and the user wants to update the expected files locally. Trigger on "update app size",…
Add this badge to your README
[](https://modelsatlas.com/skills/dotnet/fix-random-ci-test-failure/)
<a href="https://modelsatlas.com/skills/dotnet/fix-random-ci-test-failure/"><img src="https://modelsatlas.com/skills/dotnet/fix-random-ci-test-failure/badge.svg" alt="ModelsAtlas: SAFE B"></a>
Questions about Fix Random Ci Test Failure
What does the Fix Random Ci Test Failure skill do?
Is Fix Random Ci Test Failure safe to install?
What can Fix Random Ci Test Failure access on my machine?
Which assistants does Fix Random Ci Test Failure work with?
How current is this page?
Sources
- github.com/dotnet/macios/tree/main/.github/skills/fix-random-ci- — the audited source at commit bed039ebfded and every finding aboveObserved · 7 Oct 2026
Spotted something wrong? Report a correction · Methodology
Keep going in your AI
Opens with this page as the source. We add nothing else to the prompt.
- What does the Fix Random Ci Test Failure skill do?
- Is Fix Random Ci Test Failure safe to install?
- What can Fix Random Ci Test Failure access on my machine?