Search code examples
azure-service-fabric

Testing failures during Azure Service Fabric deployment


I'm performing a code based deployment of SF applications/services and wanted to test various permutations of failing conditions. Is there a way to cause those issues so that deployment status would be other than RollingForwardCompleted?


Solution

  • We have a set of fault injection actions and test scenarios you can use to put your services through all kinds of hell. If you specifically want to watch your service rollback during an upgrade, you'll need to get it to report a health error during the upgrade. You can do this in a couple ways:

    1. Service health report. Your service can send health reports to the system. This is mainly used during upgrades where the new version of a service can do a status check on itself when it starts up and report a health event accordingly. It's easy to induce a failure there - just do an upgrade to a new code version that fails the health check in some way.
    2. System health report. The system does basic health checking on your service for things that the system knows about. For example, a stateful services will report an error if it is in quorum loss. You can cause quorum loss on a stateful service using the built-in fault injection actions.