Back to Skiasharp

Monitoring Long-Running Tests

.agents/skills/release-testing/references/monitoring.md

3.119.45.6 KB
Original Source

Monitoring Long-Running Tests

Proactive diagnostics and user feedback during test execution.

Golden Rule

Users should never wait more than 30 seconds without knowing what's happening.

Update the TODO checklist at each phase. When using read_bash during long operations, acknowledge progress even if there's no new output.


Quick Reference

ActionWhen
Update TODO checklistAt each phase transition
Acknowledge progressEvery 30s during silent periods
Check device/build statusIf no output for 60+ seconds

Test Phases and Timing

Quick Tests (SmokeTests, ConsoleTests, BlazorTests)

PhaseDurationOutput Indicator
Build test project5-10s"Determining projects to restore..."
Run tests10-60s"Starting test execution, please wait..."
Complete-"Passed! - Failed: 0, Passed: N"

Feedback: These are fast enough that a single TODO update per test is sufficient.

LinuxConsoleTests (Docker)

PhaseDurationOutput Indicator
Build test project5-10s"Determining projects to restore..."
Docker image build30-90s"Building Docker image..."
Run in container5-10s"Running in Docker container..."
Complete-"Passed! - Failed: 0, Passed: 2"

First run is slower (~90s) due to Docker image layer caching. Subsequent runs use cached layers (~10s). Docker tests require SkiaSharp.NativeAssets.Linux.NoDependencies which bundles all native deps statically.

MAUI Platform Tests (iOS, Android, MacCatalyst)

PhaseDurationOutput Indicator
Build test project5-10s"Determining projects to restore..."
Test start-"Starting test execution, please wait..."
Create temp project3-5s"The template "..." was created successfully"
Add NuGet packages2-5s"PackageReference for package 'SkiaSharp..."
Build MAUI app30-120sSilence (this is the long part!)
Appium connect5s"Connecting to Appium at port 4723..."
Driver session5-10s"Driver connected, waiting for app..."
App deploy10-30sDevice/emulator shows app launching
Capture screenshot5s"Full screenshot saved"
Verify1s"✅ MAUI {Platform} passed"
Complete-"Passed! - Failed: 0, Passed: 2"

The Silent Build Phase

The Build MAUI app phase is the longest and provides no output. This is normal:

PlatformBuild Time
iOS60-90 seconds
Android90-120 seconds
MacCatalyst45-60 seconds

This silence is expected. The user needs to know this.

Verifying Build is Running

bash
ps aux | grep -E "dotnet.*build" | grep -v grep

If you see a dotnet build process, the test is progressing normally.


Providing User Feedback

TODO Checklist Format

Use a detailed checklist showing sub-steps for MAUI tests:

markdown
- [ ] MauiiOSTests (iOS 16.2 - oldest)
  - [x] Test project compiled
  - [x] Created temp MAUI project
  - [ ] Building iOS app (~60-90s)...
  - [ ] Deploying to simulator
  - [ ] Running test

During Long Waits

When using read_bash to wait for a long operation:

  1. Before the wait: Update checklist to show current phase
  2. After each read (if still running): Add progress note with elapsed time
  3. On completion: Mark step done, move to next

Phase-Specific Feedback Messages

PhaseWhat to Say
Build test project"Building test project..."
Create temp project"Creating MAUI app from template..."
Build MAUI app"Building for {platform} (~60-90s)..."
Still building (30s check)"⏳ Still building (~30s elapsed)"
Still building (60s check)"⏳ Still building (~60s elapsed)"
Build complete"✅ Build complete"
Deploy"Deploying app to {device}..."
Run test"Running Appium test..."
Verify"Verifying screenshot..."
Done"✅ Passed"

Example: Full Test Feedback Flow

🔄 Running MauiiOSTests (iOS 16.2)
  ✅ Test project compiled
  ✅ Created MauiiOSSKCanvasView project
  ⏳ Building iOS app (~60-90s expected)...
     ⏳ Still building (~30s elapsed)
     ⏳ Still building (~60s elapsed)
  ✅ Build complete (~75s)
  ⏳ Deploying to iPhone 14 Pro simulator...
  ✅ App deployed, running test...
  ✅ Screenshot captured and verified
  ✅ MauiiOSTests (iOS 16.2) passed!

Detecting Problems

SymptomLikely CauseAction
Silent after "Starting test execution"MAUI app buildingNormal - wait, update user
No build process, 120+ secondsBuild stuck/failedCheck for errors
"Connecting to Appium" then silenceDriver creation failedCheck Appium logs
App appears then disappearsApp crashedCheck device logs
"Could not find canvas element"UI didn't renderWill auto-retry, wait

Checking Device Status

Android:

bash
adb devices -l
adb logcat -d | grep -E "(FATAL|crash|died)" | tail -10

iOS:

bash
xcrun simctl list devices booted

When to Intervene

ConditionAction
Build running, < 2 minutesWait — builds are slow, this is normal
Build running, > 3 minutesSomething may be wrong, check logs
No build process, > 60s silenceCheck for errors in test output
App crashes repeatedlyStop, investigate (see troubleshooting.md)
Device unresponsiveKill device/emulator, restart, retry