Table of Contents

Common Issues

This guide covers the most frequently encountered issues when using the Xping SDK and their solutions.


Connection & Network Issues

Tests Not Appearing in Xping Cloud

Symptoms:

  • Tests run successfully but don't appear in Xping Cloud
  • No error messages in test output
  • SDK appears to be working

Common Causes & Solutions:

1. Missing or Invalid Credentials

Check that ApiKey is configured (ProjectId is optional):

# Verify environment variables are set
echo $XPING_APIKEY

Or check your appsettings.json:

{
  "Xping": {
    "ApiKey": "xpg_live_your_key_here",
  }
}

Solution: Set both values. See Configuration Reference for details.


2. SDK Disabled

The SDK may be disabled via configuration:

# Check if SDK is disabled
echo $XPING_ENABLED

Solution: Ensure Enabled is true (default) or remove the setting entirely.


3. Network Connectivity Issues

The SDK requires outbound HTTPS access to upload.xping.io.

Test connectivity:

# Test HTTPS connection
curl -v https://upload.xping.io

# Or with PowerShell (Windows)
Test-NetConnection -ComputerName upload.xping.io -Port 443

Common blockers:

  • Corporate firewall blocking outbound HTTPS
  • Proxy server requiring authentication
  • Network security policies blocking SDK traffic
  • DNS resolution issues

Solution: Work with your network team to allowlist upload.xping.io on port 443 (HTTPS).


4. Missing Test Teardown (NUnit & MSTest)

Note: This issue is specific to NUnit and MSTest. xUnit automatically handles teardown through its custom test framework—no manual teardown required.

Test results are uploaded in batches automatically when:

  • The batch size is reached (default: 100 tests collected), OR
  • The flush interval timer fires (default: every 30 seconds), OR
  • The test session completes and teardown flushes remaining tests

For small test suites:

If you run 10 tests with proper teardown, all 10 tests will upload immediately when the test suite completes, regardless of batch size or flush interval.

Common mistake (NUnit/MSTest only): Missing or incorrect teardown:

❌ Missing teardown (NUnit):

// No [OneTimeTearDown] - tests may remain in buffer
[SetUpFixture]
public class XpingSetup
{
    [OneTimeSetUp]
    public void Setup() => XpingContext.Initialize();
    
    // Missing teardown!
}

❌ Missing teardown (MSTest):

// No [AssemblyCleanup] - tests may remain in buffer
[TestClass]
public static class XpingSetup
{
    [AssemblyInitialize]
    public static void AssemblyInit(TestContext context) 
        => XpingContext.Initialize();
    
    // Missing cleanup!
}

✅ Correct teardown (NUnit):

[SetUpFixture]
public class XpingSetup
{
    [OneTimeSetUp]
    public void Setup() => XpingContext.Initialize();
    
    [OneTimeTearDown]
    public async Task Teardown()
    {
        await XpingContext.FinalizeAndShutdownAsync();
    }
}

✅ Correct teardown (MSTest):

[TestClass]
public static class XpingSetup
{
    [AssemblyInitialize]
    public static void AssemblyInit(TestContext context)
        => XpingContext.Initialize();
    
    [AssemblyCleanup]
    public static async Task AssemblyCleanup()
    {
        await XpingContext.FinalizeAndShutdownAsync();
    }
}

✅ xUnit - No manual teardown needed:

// xUnit's XpingTestFramework handles initialization and disposal automatically
[assembly: TestFramework("Xping.Sdk.XUnit.XpingTestFramework", "Xping.Sdk.XUnit")] // xUnit v2
[assembly: TestFramework(typeof(Xping.Sdk.XUnit.V3.XpingTestFramework))]           // xUnit v3

// That's it! No manual teardown required for xUnit.

Solution:

  • NUnit/MSTest: Ensure proper test teardown is implemented as shown above or in the Getting Started guides
  • xUnit: Verify the [assembly: TestFramework(...)] attribute is configured in AssemblyInfo.cs (see xUnit Getting Started)

5. Silent Upload Failures

If uploads fail (network issues, invalid credentials), the SDK logs errors but doesn't throw exceptions — your tests continue running normally.

Solution: Enable logging to see what's happening. See Debugging Guide.


Connection Timeout Errors

Symptoms:

  • Slow test execution
  • Timeout messages in logs
  • Intermittent upload failures

Common Causes:

  1. Slow Network Connection

    • Default upload timeout is 30 seconds
    • Large batches may take longer on slow connections

    Solution: Increase UploadTimeout:

    {
      "Xping": {
        "UploadTimeout": "00:01:00"  // 60 seconds
      }
    }
    
  2. Large Batch Sizes

    • Batches with stack traces can be large
    • Compression helps but may not be enough

    Solution: Reduce BatchSize or disable stack trace capture:

    {
      "Xping": {
        "BatchSize": 50,
        "CaptureStackTraces": false
      }
    }
    
  3. Proxy Interference

    • Corporate proxies may interfere with HTTPS connections
    • Proxy authentication may be required

    Solution: Currently, the SDK doesn't have built-in proxy support. However, you can configure a local proxy that forwards to upload.xping.io and set ApiEndpoint to your proxy URL:

    {
      "Xping": {
        "ApiEndpoint": "http://localhost:8888"  // Your local proxy
      }
    }
    

This functionality has not been tested in production environments. It is provided as a troubleshooting option for evaluation purposes only.


Circuit Breaker Open

Symptoms:

  • Error message: "Circuit breaker is open: Too many consecutive failures"
  • Uploads stopped temporarily
  • Message indicates automatic reset after 30 seconds

What This Means:

The SDK's resilience system has detected repeated upload failures (50% failure rate over 10+ attempts) and has temporarily stopped attempting uploads to prevent cascading failures.

Common Causes:

  • Xping API temporarily unavailable
  • Network issues causing consistent failures
  • Invalid credentials causing repeated 401/403 errors

Solution:

  1. Wait for automatic reset: The circuit breaker reopens after 30 seconds
  2. Check network connectivity: Verify connection to upload.xping.io
  3. Review logs: Enable debug logging to see underlying failure reasons
  4. Verify credentials: Ensure the API key is valid

Prevention: Address the root cause (network, credentials, API issues) before the circuit breaker triggers.


Authentication & Authorization

HTTP 401: Authentication Failed

Error Message:

Authentication failed (401): Invalid API Key
Action: Verify credentials at https://app.xping.io

Causes:

  1. API key is incorrect or expired
  2. API key doesn't exist in the Xping platform
  3. Typo in API key (extra spaces, wrong characters)

Solution:

  1. Verify your API key at Xping Cloud
  2. Navigate to Account → Settings → API & Integration
  3. Copy the correct API key
  4. Update your configuration:
export XPING_APIKEY="xpg_live_correct_key_here"

Common mistakes:

  • Using test/development key in production
  • API key rotation without updating configuration
  • Hardcoded keys in source control (security risk!)

HTTP 403: Authorization Failed

Error Message:

Authorization failed (403): Insufficient permissions
Action: Check project access at https://app.xping.io

Causes:

  1. API key is valid but doesn't have permission to create or access projects
  2. API key has been revoked or disabled
  3. Account-level permissions issue

Solution:

  1. Verify your API key status in Xping Cloud
  2. Navigate to Account → Settings → API & Integration
  3. Check that the API key has appropriate permissions
  4. If needed, create a new API key with full permissions

Note: You don't need to create a project manually in Xping Cloud. With no ProjectId set, each test assembly gets its own project, named after the assembly and created on the first run.

My tests created several projects

That is the default. Each test assembly reports into its own project, so a solution-wide dotnet test covering Billing.Tests, Api.Tests and Web.Tests produces three projects.

To report them all as one project instead, pin it:

export XPING_PROJECTID="my-app"

HTTP 429: Rate Limit Exceeded

Error Message:

Rate limit exceeded (429): Too many requests
Action: Reduce test execution frequency or contact support

Causes:

  1. Executing tests too frequently
  2. Multiple test runners uploading simultaneously
  3. Small batch sizes causing too many API calls
  4. Running large test suites continuously

Solution:

  1. Increase batch size to reduce API call frequency:

    {
      "Xping": {
        "BatchSize": 500  // Larger batches = fewer API calls
      }
    }
    
  2. Increase flush interval to batch more tests:

    {
      "Xping": {
        "FlushInterval": "00:02:00"  // 2 minutes
      }
    }
    
  3. Coordinate with team: Ensure multiple team members aren't running tests against the same project simultaneously

  4. Contact support if you need higher rate limits for legitimate use cases


CLI Sign-in (xping login)

Start with xping auth status. It makes no network call and says which credential the CLI would use. Add --verbose to any command for the details. See the CLI reference.

"Cloud data unavailable: your sign-in is no longer valid"

The session was revoked (on Settings → Security → CLI sessions, or when a workspace key was withdrawn) or it expired. The CLI has already removed it. Run xping login again.

xping login says it needs an interactive terminal

login runs only in your own shell. It refuses when stdin or stderr is not a terminal — every pipeline agent and coding agent — and when CI is true, 1 or yes. CI uses an API key that can read Cloud data (XPING_APIKEY); an agent should ask you to run xping login yourself.

The browser never returns to the CLI

The sign-in page sends the browser back to 127.0.0.1 on the machine running the CLI. Over SSH, in a container, or in WSL with localhost forwarding turned off, that address is not the CLI's. Press Ctrl+C and run xping login --device, which works with a browser on any device.

"Refusing to read ~/.xping/credentials.json because other users can read it"

The sign-in file is only used when no OS credential store is available. Restore its permissions:

chmod 700 ~/.xping
chmod 600 ~/.xping/credentials.json

"This API key cannot read Cloud data"

The key is upload-only, or the workspace's plan does not include API access. Sign in with xping login on your machine, or give CI a key with read scope. The report itself is unaffected.

"Could not write to Windows Credential Manager (error 8…)"

Windows refused to store any credential for your account; cmdkey /generic:test /user:x /pass:y fails with the same message. xping login keeps the sign-in in ~/.xping/credentials.json instead, so the CLI works. The cause is usually a damaged Windows user profile; other apps that save passwords on this account are affected too.

macOS asks for keychain access after every upgrade

The xping tool is not signed by Apple, so macOS asks once per installed version. Choose Always Allow.


Installation Issues

Wrong xUnit adapter (XPING001, XPING002)

Symptoms: The build of your test project stops with one of:

error XPING001: Xping.Sdk.XUnit supports xUnit v2, but this project references xUnit v3 (xunit.v3). Replace it with Xping.Sdk.XUnit.V3.
error XPING002: Xping.Sdk.XUnit.V3 supports xUnit v3, but this project references xUnit v2 (xunit). Replace it with Xping.Sdk.XUnit.

Cause: Xping has one adapter per xUnit version, and the one installed does not match the xUnit package the project references.

Solution: Swap the package the error names, and use the matching attribute:

# XPING001: the project is on xUnit v3
dotnet remove package Xping.Sdk.XUnit
dotnet add package Xping.Sdk.XUnit.V3

# XPING002: the project is on xUnit v2
dotnet remove package Xping.Sdk.XUnit.V3
dotnet add package Xping.Sdk.XUnit

See Which Package? for the attribute each one needs.

CS0433: The type 'FactAttribute' exists in both 'xunit.core' and 'xunit.v3.core' is the same mistake in a build that skips the check above, for example one that does not import NuGet's buildTransitive files. The fix is the same.


Configuration Issues

Configuration Not Loading

Symptoms:

  • SDK uses default values instead of your configuration
  • Environment variables ignored
  • appsettings.json not being read

Common Causes:

1. Wrong Environment Variable Names

Environment variables must use double underscores for nested properties:

❌ Incorrect:

export XPING.APIKEY="key"           # Wrong: uses dot
export XPING_APIKEY="key"          # Wrong: snake_case

✅ Correct:

export XPING__APIKEY="key"          # Correct: double underscore
export XPING__PROJECTID="project"   # Correct: double underscore

2. JSON File Not Found

The SDK looks for appsettings.json in the working directory or alongside the test assembly.

Solution:

  • Ensure appsettings.json is in the correct location
  • Set Copy to Output Directory to Copy if newer in Visual Studio
  • Or use absolute paths for configuration files

3. Invalid JSON Syntax

Solution: Validate your JSON:

# Validate JSON syntax (requires jq)
cat appsettings.json | jq .

# Or use online JSON validators

4. Case Sensitivity

Configuration property names are case-sensitive in JSON:

❌ Incorrect:

{
  "Xping": {
    "apikey": "key",      // Wrong: lowercase
    "PROJECTID": "id"     // Wrong: uppercase
  }
}

✅ Correct:

{
  "Xping": {
    "ApiKey": "key",      // Correct: PascalCase
    "ProjectId": "id"     // Correct: PascalCase
  }
}

Configuration Validation Errors

Symptoms:

  • SDK initialization fails
  • Error messages about invalid configuration values

Common Issues:

  1. Invalid Value Ranges:

    • BatchSize: Must be between 1 and 1000
    • MaxRetries: Must be between 0 and 10
    • FlushInterval: Must be greater than zero
  2. Invalid TimeSpan Format:

    {
      "Xping": {
        "FlushInterval": "30",         // ❌ Wrong: not TimeSpan format
        "FlushInterval": "00:00:30"    // ✅ Correct: HH:MM:SS format
      }
    }
    
  3. Invalid URLs:

    • ApiEndpoint must be a valid HTTP or HTTPS URL
    • Don't include trailing slashes

Solution: Review Configuration Reference for valid values and formats.


Performance Issues

Test Suite Running Slowly

Symptoms:

  • Tests take longer to complete than expected
  • Performance degradation after adding Xping SDK

Expected Overhead:

The Xping SDK is designed to add minimal overhead:

  • <5ms per test on average
  • <1KB memory per test execution
  • <5% CPU overhead

See Performance Testing Overview for detailed benchmarks.

If you're seeing higher overhead:

1. Synchronous Flushing

Avoid calling FlushAsync() after every test—this blocks test execution:

❌ Bad:

[Test]
public async Task MyTest()
{
    // Test code
    await XpingContext.FlushAsync();  // Don't do this!
}

✅ Good:

[OneTimeTearDown]  // Upload once, after all tests
public async Task Cleanup()
{
    await XpingContext.FinalizeAndShutdownAsync();
}

2. Stack Trace Capture

Capturing stack traces adds overhead for failed tests:

Solution: Disable if you don't need stack traces:

{
  "Xping": {
    "CaptureStackTraces": false
  }
}

3. Network Issues

Slow network connections can impact performance if batches fill up frequently.

Solution:

  • Increase BatchSize to batch more tests
  • Increase FlushInterval to reduce upload frequency

4. Compression Overhead

Compression reduces payload size but adds CPU overhead.

Solution: Disable compression if network bandwidth is not an issue:

{
  "Xping": {
    "EnableCompression": false
  }
}

Session Summary Duration Differs from Test Framework's Reported Duration

Symptoms:

  • The SDK's session finalized log shows a much smaller duration than the test framework's own summary, e.g.:
    [Xping 00:26:55 INF] Total tests recorded: 12 · "9 passed, 2 failed, 1 skipped" · exec: 118ms · wall: 1204ms
    Test summary: total: 12, failed: 2, succeeded: 9, skipped: 1, duration: 1.1s
    

Why This Happens:

The Xping session log reports two distinct duration metrics, both correct but measuring different things:

  • exec (QuickStatistics.TotalDurationMs) is the sum of each individual test's own execution time (each test's Duration), accumulated across every recorded test.
  • wall (QuickStatistics.WallClockDurationMs) is the elapsed wall-clock time for the whole Xping session, from SDK initialization to finalization—closer to the test framework's own duration, but still may not perfectly match it since it doesn't include time spent before Initialize() (e.g. assembly loading, test discovery) or after FinalizeAsync() returns.

The test framework's own reported duration is the wall-clock time for the entire run, which also includes assembly loading, test discovery, fixture setup/teardown, parallelization scheduling, and the runner's own reporting overhead—none of which is attributed to any single test's exec time.

For small or fast test suites, framework/runtime overhead can easily dominate the wall-clock time, making exec and wall/the framework's duration diverge significantly. This is expected behavior, not a bug.

Solution: No action needed. Use exec to gauge actual test-body execution cost, and wall (or your test framework's own summary output) to gauge the true end-to-end run time including overhead.


High Memory Usage

Symptoms:

  • Increased memory consumption during test execution
  • Out of memory errors in large test suites

Expected Memory Usage:

  • <1KB per test execution for metadata
  • <50MB for 10,000 tests buffered in memory

If memory usage is higher:

1. Large Batch Sizes

Larger batches keep more data in memory before uploading:

Solution: Reduce BatchSize:

{
  "Xping": {
    "BatchSize": 50  // Smaller batches = less memory
  }
}

2. Stack Traces

Stack traces consume significant memory, especially for deep call stacks:

Solution: Disable stack trace capture:

{
  "Xping": {
    "CaptureStackTraces": false
  }
}

3. Upload Failures

If uploads fail repeatedly, tests accumulate in memory:

Solution:

  • Fix upload issues (network, credentials)
  • Monitor logs for upload errors

CI/CD Specific Issues

CI Not Detected

Symptoms:

  • IsCIEnvironment is false on a pipeline run
  • CI-specific metadata (build number, commit SHA) not captured

Not a symptom: the environment name reading Default on a CI run. That is correct. Environment names the deployed environment your tests targeted, not the machine they ran on, so a pipeline run and a local run of the same suite deliberately share one name. CI-ness is recorded by the IsCIEnvironment flag and the ExecutionContext custom property instead. See Environment.

Solution:

Detection is automatic and always on - there is no flag to enable. It keys off the platform's own environment variables, so it fails only when none of them are present in the test process.

Supported CI/CD platforms:

  • GitHub Actions
  • Azure DevOps
  • GitLab CI/CD
  • Jenkins
  • CircleCI
  • Travis CI
  • TeamCity
  • Generic CI (via CI=true environment variable)

For unsupported platforms: set CI=true in the pipeline. That is the generic signal, and it gets you IsCIEnvironment plus the developer-machine and git-metadata behaviour that depends on it.

export CI=true

Do not reach for XPING_ENVIRONMENT="CI" here. It would name the deployment "CI", splitting every affected test's scored history away from the local runs of the same suite.


Secrets & API Keys in CI/CD

Symptoms:

  • API key exposed in logs
  • Build fails due to missing credentials
  • Security scanning flags hardcoded keys

Solution:

Never hardcode API keys in source code or configuration files.

Use CI/CD secret management:

GitHub Actions:

- name: Run Tests
  env:
    XPING__APIKEY: ${{ secrets.XPING_APIKEY }}
    XPING__PROJECTID: ${{ secrets.XPING_PROJECTID }}
  run: dotnet test

Azure DevOps:

- task: DotNetCoreCLI@2
  inputs:
    command: 'test'
  env:
    XPING__APIKEY: $(XpingApiKey)      # From pipeline variables
    XPING__PROJECTID: $(XpingProjectId)

GitLab CI:

test:
  script:
    - dotnet test
  variables:
    XPING__APIKEY: $XPING_APIKEY      # From GitLab CI/CD variables
    XPING__PROJECTID: $XPING_PROJECTID

See CI/CD Setup Guide for platform-specific instructions.


Parallel Test Execution Issues

Symptoms:

  • Tests fail when running in parallel
  • Inconsistent results between parallel and sequential runs
  • Thread safety warnings

Solution:

The Xping SDK is designed to be thread-safe and supports parallel test execution. However, proper initialization and cleanup are essential.

Note: Setup and teardown patterns vary by test framework. See examples below for your framework.

Key requirements (all frameworks):

  • Initialize once per test session (not per test)
  • Ensure proper cleanup/teardown
  • Avoid calling Initialize() in individual test methods

NUnit:

[SetUpFixture]
public class XpingSetup
{
    [OneTimeSetUp]
    public void Setup()
    {
        XpingContext.Initialize();
    }

    [OneTimeTearDown]
    public async Task Cleanup()
    {
        await XpingContext.FinalizeAndShutdownAsync();
    }
}

MSTest:

[TestClass]
public static class XpingSetup
{
    [AssemblyInitialize]
    public static void AssemblyInit(TestContext context)
    {
        XpingContext.Initialize();
    }

    [AssemblyCleanup]
    public static async Task AssemblyCleanup()
    {
        await XpingContext.FinalizeAndShutdownAsync();
    }
}

xUnit:

// Add to AssemblyInfo.cs - initialization and cleanup are automatic
[assembly: TestFramework("Xping.Sdk.XUnit.XpingTestFramework", "Xping.Sdk.XUnit")] // xUnit v2
[assembly: TestFramework(typeof(Xping.Sdk.XUnit.V3.XpingTestFramework))]           // xUnit v3

For detailed setup instructions, see the Getting Started guides for your test framework.


Data & Metrics Issues

Missing Test Results

Symptoms:

  • Some tests appear in Xping Cloud, others don't
  • Inconsistent test result uploads

Common Causes:

1. Test Name Issues

Very long test names may be truncated or rejected.

Solution: Keep test names reasonable (<500 characters).


2. Upload Failures

Individual upload failures may result in lost test data.

Solution: Enable logging to identify upload issues. See Debugging Guide.


Flaky Test Detection Not Working

Symptoms:

  • Tests marked as flaky in your suite aren't detected by Xping
  • Confidence scores don't reflect test instability

Important: Flaky test detection requires statistical data over time.

Requirements:

  • Minimum 10 test executions for statistical analysis
  • Consistent test names across runs
  • Time to process uploaded data (asynchronous processing)

What to expect:

  1. First run: Tests upload, no flakiness data yet
  2. Runs 2-9: Data accumulates, analysis begins
  3. Run 10+: Flakiness detection becomes reliable

If detection still isn't working after 10+ runs:

  1. Verify tests are actually flaky (not environment issues)
  2. Check that test names are consistent across runs
  3. Ensure sufficient pass/fail variation for detection
  4. Review Xping Cloud filters—flaky tests may be filtered out

Troubleshooting Checklist

Before seeking support, verify:

  • ✅ API Key is configured correctly
  • ✅ Network connectivity to upload.xping.io is working
  • ✅ SDK is enabled (Enabled = true)
  • ✅ Configuration is valid (proper JSON syntax, value ranges)
  • ✅ Logs are enabled to see detailed diagnostics
  • ✅ Latest SDK version is installed
  • ✅ Test framework integration is set up correctly

Getting Help

If you're still experiencing issues after trying these solutions:

  1. Enable debug logging to capture detailed diagnostics (see Debugging Guide)
  2. Check the documentation:
  3. Contact support:
    • Email: support@xping.io
    • Include: SDK version, .NET version, test framework, logs, and configuration (redact API keys!)