SlideShare ist ein Scribd-Unternehmen logo
1 von 28
Downloaden Sie, um offline zu lesen
Testing Distributed
Systems in Production.
|Paul Bakker
@pbakker
Paul Bakker
Edge Developer Productivity @ Netflix
Paul Bakker
@pbakker
Contents.
Types of testing for micro services
Simulation testing
Simone example
Simulation testing architecture
Client libs vs grpc
Micro
Service
R
E
S
T
DRM
Playback
Micro
Service
g
r
p
c
Streaming
logs
Edge
Zuul
Edge Developer
Experience
Device API
scripts
Content
Types of testing
Within each service
Unit / Integration / Smoke testing
Functional tests in a test environment
Performance / squeeze testing
Shadow traffic / Replay
Canary
Simulations in production
Infra
Failure Injection Testing
Chaos engineering
Failover/Evacuation exercises
Wait, aren’t micro
services suppose to be
easy!?
Test vs Prod environment
Two separate AWS environments
Test closely mimics Prod
Smaller capacity
Data is different (caches, customer data, etc.)
In-process smoke tests.
Bootstraps the service from a JUnit test
All dependencies are real (test environment)
Tests hit the in-process server on HTTP or grpc
Service owners should spend a lot of time here
In-process smoke tests.
@Singleton
@Path("v1/hello")
public final class MemeTestingExamplesResource {
/** Where we keep our greetings for each user. */
private final MemeTestingExamplesDao memeTestingExamplesDao;
private final MemeTestingExamplesConfig config;
@Inject
public MemeTestingExamplesResource(
MemeTestingExamplesDao memeTestingExamplesDao,
MemeTestingExamplesConfig config,
Registry registry) {
this.memeTestingExamplesDao = memeTestingExamplesDao;
this.config = config;
}
@Path("{user}")
@GET
@Produces({MediaType.APPLICATION_JSON})
public Greeting getGreeting(@PathParam("user") String userEmail) {
return memeTestingExamplesDao.loadGreeting(userEmail).orElseGet( () -> {
Greeting annonymousGreeting = new Greeting();
annonymousGreeting.setUserEmail(userEmail);
annonymousGreeting.setFirstName(config.getDefaultAnonymousName());
annonymousGreeting.setMessage(config.getDefaultGreeting());
return annonymousGreeting;
});
}
@POST
@Produces({MediaType.APPLICATION_JSON})
@Consumes({MediaType.APPLICATION_JSON})
public String setGreeting(Greeting greeting) {
memeTestingExamplesDao.storeGreeting(greeting);
return ""OK"";
}
}
@RunWith(GovernatorJunit4ClassRunner.class)
@ModulesForTesting({MemeTestingExamplesModule.class, Archaius2JettyModule.class})
@TestPropertyOverride(value={“governator.jetty.embedded.port=0"},
propertyFiles={"laptop.properties"})
public class SmokeTest {
@Inject
@Named("embeddedJettyPort")
private int ephemeralPort;
@Test
public void testRestEndpoint() {
given().port(ephemeralPort).log().ifValidationFails()
.when()
.get("/REST/v1/hello/n@n.com")
.then()
.assertThat().statusCode(200)
.and()
.body("userEmail", equalTo("n@n.com"));
}
}
Service to test
Test
In-process smoke tests
vs deployments.
Faster to run
Less moving parts (Jenkins, Spinnaker, AWS etc.) => Less flakiness
Options for mocking some dependencies
Functional and squeeze tests
Validate service from perspective of service consumers
Deploy to a test cluster
Create a reference application that integrates with your service, using your
client lib
Run tests against reference app application
Tests Reference App Service
http / grpc http / grpc
Shadow traffic
Zuul
Prod
cluster
Shadow
cluster
100%
100%
Send all traffic to a second cluster
Shadow cluster drops responses, but generates metrics
Good for performance testing, and high level correctness (e.g. error rate)
Canaries
Zuul
Baseline
cluster
Canary
cluster
90%
10%
Send a percentage of traffic to a second cluster
Track metrics to find issues compared to baseline
This affects production traffic!
Chaos and Failure Injection Testing
Test failover and fallback scenarios
Introduce failures or latency in the http/grpc layer
Terminate instances
Datastore failure/latency
Region failover exercises
Exercises the capability to fail out of a region
E.g. what happens if an AWS region goes dark?
Commonly exposes (minor) issues
Make sure you can recover quickly!
https://www.techrepublic.com/article/aws-outage-how-netflix-weathered-the-storm-by-preparing-for-the-worst/
SimulationTesting.
Simulation Testing
End to end tests
Device certification
Content validation (e.g. fixes to subtitles)
The device is unaware of any simulations
How to externally trigger
special behavior in a service?
Simone ServerMicro service
simone-client
/REST/variants
Kafka
2. Publish Variant to clients3. Receive Variant
6. Consume
Test script
1. Create Variant
Cassandra
ElasticSearch
Dynomite
API
4. Start test
5. Check variants
/REST/insights
7. Verify variant insights
Variant storage
Insights
Simone architecture
Simone Demo.
Does a device behave correctly with different bit rates?
Bitrates are adaptive, they change depending on bandwidth
Simone ServerMicro service
simone-client
/REST/variants
Kafka
2. Publish Variant to clients3. Receive Variant
6. Consume
Test script
1. Create Variant
Cassandra
ElasticSearch
Dynomite
API
4. Start test
5. Check variants
/REST/insights
7. Verify variant insights
Variant storage
Insights
Simone architecture
Who needs a test
environment…
When you can just test
in prod!?
Why run in prod!?
Devices are unaware of tests
They only know the real thing
They can’t access internal systems
Also, caching is hard…
Other examples
Testing license failures
Testing “too many devices”
Testing CDN overrides
Forcing API errors
SimulationResponse response =
simoneClient.execute("com.netflix.okja.regressiontests.TestTemplate", Trigger.esnTrigger(request.getEsn()),
getPassport(request.getCustomerId(), request.getEsn()),
() -> SimulationResponse.newBuilder().setVariantApplied(false).setMessage("No variant found").build(),
(ctx) -> SimulationResponse.newBuilder().setVariantApplied(true).setMessage("Variant applied").build(),
(ctx) -> ctx.setDomainData(request.getDomainDataJson())
);
Simone client example
Type of simulation to run
How to trigger the simulation. E.g. by customerId, esn, viewableId…
User for this request (can we pre-check for test users!?)
Default handler, no simulation is found
Simulation handler
Post handler - Apply extra logging for insights
Get out of the critical path!
We’re embedded in most tier 1 services
What if we mess up?
Have really aggressive grpc timeouts
Circuit breakers
Pre-checks if we should run at all
Thank you.
Paul Bakker
@pbakker

Weitere ähnliche Inhalte

Was ist angesagt?

Serverless in production, an experience report (CoDe-Conf)
Serverless in production, an experience report (CoDe-Conf)Serverless in production, an experience report (CoDe-Conf)
Serverless in production, an experience report (CoDe-Conf)Yan Cui
 
Static Code Analysis: Keeping the Cost of Bug Fixing Down
Static Code Analysis:  Keeping the Cost of Bug Fixing DownStatic Code Analysis:  Keeping the Cost of Bug Fixing Down
Static Code Analysis: Keeping the Cost of Bug Fixing DownAndrey Karpov
 
Serverless in production, an experience report (Going Serverless, 28 Feb 2018)
Serverless in production, an experience report (Going Serverless, 28 Feb 2018)Serverless in production, an experience report (Going Serverless, 28 Feb 2018)
Serverless in production, an experience report (Going Serverless, 28 Feb 2018)Domas Lasauskas
 
2018 Cisco DevNet Create : How to Treat a Network as a Container
2018 Cisco DevNet Create : How to Treat a Network as a Container2018 Cisco DevNet Create : How to Treat a Network as a Container
2018 Cisco DevNet Create : How to Treat a Network as a ContainerRosemary Wang
 
Intro to front-end testing
Intro to front-end testingIntro to front-end testing
Intro to front-end testingJuriy Zaytsev
 
Agile analysis development
Agile analysis developmentAgile analysis development
Agile analysis developmentsetitesuk
 
Fosdem2012 : JBoss Forge & Arquillian
Fosdem2012 : JBoss Forge & ArquillianFosdem2012 : JBoss Forge & Arquillian
Fosdem2012 : JBoss Forge & Arquilliankoentsje
 
Selenium Camp 2016 - Kiev, Ukraine
Selenium Camp 2016 -  Kiev, UkraineSelenium Camp 2016 -  Kiev, Ukraine
Selenium Camp 2016 - Kiev, UkraineJustin Ison
 
Postman for Efficient Professional Services: Collaboration, Mocking Dependenc...
Postman for Efficient Professional Services: Collaboration, Mocking Dependenc...Postman for Efficient Professional Services: Collaboration, Mocking Dependenc...
Postman for Efficient Professional Services: Collaboration, Mocking Dependenc...Postman
 
How do you tame a big ball of mud? One test at a time.
How do you tame a big ball of mud? One test at a time.How do you tame a big ball of mud? One test at a time.
How do you tame a big ball of mud? One test at a time.Matt Eland
 
Just kill it
Just kill itJust kill it
Just kill itpwhitdog
 
Chris Omland - AWS Code Deploy - BSDC 2016
Chris Omland - AWS Code Deploy - BSDC 2016Chris Omland - AWS Code Deploy - BSDC 2016
Chris Omland - AWS Code Deploy - BSDC 2016roblund
 
When Good Code Goes Bad: Tools and Techniques for Troubleshooting Plone
When Good Code Goes Bad: Tools and Techniques for Troubleshooting PloneWhen Good Code Goes Bad: Tools and Techniques for Troubleshooting Plone
When Good Code Goes Bad: Tools and Techniques for Troubleshooting PloneDavid Glick
 
Delivery pipelines at Symphony Talent - Present and Future
Delivery pipelines at Symphony Talent - Present and FutureDelivery pipelines at Symphony Talent - Present and Future
Delivery pipelines at Symphony Talent - Present and FutureNathan Jones
 
Automated testing in javascript
Automated testing in javascriptAutomated testing in javascript
Automated testing in javascriptMichael Yagudaev
 
Si fa presto a dire serverless
Si fa presto a dire serverlessSi fa presto a dire serverless
Si fa presto a dire serverlessAlessio Coser
 
Automated Exploratory Testing
Automated Exploratory TestingAutomated Exploratory Testing
Automated Exploratory TestingJustin Ison
 
How to build observability into a serverless application
How to build observability into a serverless applicationHow to build observability into a serverless application
How to build observability into a serverless applicationYan Cui
 

Was ist angesagt? (20)

Serverless in production, an experience report (CoDe-Conf)
Serverless in production, an experience report (CoDe-Conf)Serverless in production, an experience report (CoDe-Conf)
Serverless in production, an experience report (CoDe-Conf)
 
Static Code Analysis: Keeping the Cost of Bug Fixing Down
Static Code Analysis:  Keeping the Cost of Bug Fixing DownStatic Code Analysis:  Keeping the Cost of Bug Fixing Down
Static Code Analysis: Keeping the Cost of Bug Fixing Down
 
Serverless in production, an experience report (Going Serverless, 28 Feb 2018)
Serverless in production, an experience report (Going Serverless, 28 Feb 2018)Serverless in production, an experience report (Going Serverless, 28 Feb 2018)
Serverless in production, an experience report (Going Serverless, 28 Feb 2018)
 
2018 Cisco DevNet Create : How to Treat a Network as a Container
2018 Cisco DevNet Create : How to Treat a Network as a Container2018 Cisco DevNet Create : How to Treat a Network as a Container
2018 Cisco DevNet Create : How to Treat a Network as a Container
 
Intro to front-end testing
Intro to front-end testingIntro to front-end testing
Intro to front-end testing
 
Agile analysis development
Agile analysis developmentAgile analysis development
Agile analysis development
 
Zero to Test Driven Infrastructure
Zero to Test Driven Infrastructure Zero to Test Driven Infrastructure
Zero to Test Driven Infrastructure
 
Fosdem2012 : JBoss Forge & Arquillian
Fosdem2012 : JBoss Forge & ArquillianFosdem2012 : JBoss Forge & Arquillian
Fosdem2012 : JBoss Forge & Arquillian
 
Selenium Camp 2016 - Kiev, Ukraine
Selenium Camp 2016 -  Kiev, UkraineSelenium Camp 2016 -  Kiev, Ukraine
Selenium Camp 2016 - Kiev, Ukraine
 
Postman for Efficient Professional Services: Collaboration, Mocking Dependenc...
Postman for Efficient Professional Services: Collaboration, Mocking Dependenc...Postman for Efficient Professional Services: Collaboration, Mocking Dependenc...
Postman for Efficient Professional Services: Collaboration, Mocking Dependenc...
 
How do you tame a big ball of mud? One test at a time.
How do you tame a big ball of mud? One test at a time.How do you tame a big ball of mud? One test at a time.
How do you tame a big ball of mud? One test at a time.
 
Just kill it
Just kill itJust kill it
Just kill it
 
Chris Omland - AWS Code Deploy - BSDC 2016
Chris Omland - AWS Code Deploy - BSDC 2016Chris Omland - AWS Code Deploy - BSDC 2016
Chris Omland - AWS Code Deploy - BSDC 2016
 
When Good Code Goes Bad: Tools and Techniques for Troubleshooting Plone
When Good Code Goes Bad: Tools and Techniques for Troubleshooting PloneWhen Good Code Goes Bad: Tools and Techniques for Troubleshooting Plone
When Good Code Goes Bad: Tools and Techniques for Troubleshooting Plone
 
Delivery pipelines at Symphony Talent - Present and Future
Delivery pipelines at Symphony Talent - Present and FutureDelivery pipelines at Symphony Talent - Present and Future
Delivery pipelines at Symphony Talent - Present and Future
 
Services discovery in Docker
Services discovery in DockerServices discovery in Docker
Services discovery in Docker
 
Automated testing in javascript
Automated testing in javascriptAutomated testing in javascript
Automated testing in javascript
 
Si fa presto a dire serverless
Si fa presto a dire serverlessSi fa presto a dire serverless
Si fa presto a dire serverless
 
Automated Exploratory Testing
Automated Exploratory TestingAutomated Exploratory Testing
Automated Exploratory Testing
 
How to build observability into a serverless application
How to build observability into a serverless applicationHow to build observability into a serverless application
How to build observability into a serverless application
 

Ähnlich wie Testing distributed systems in production

AWS Lambda from the trenches
AWS Lambda from the trenchesAWS Lambda from the trenches
AWS Lambda from the trenchesYan Cui
 
Uber Mobility Meetup: Mobile Testing
Uber Mobility Meetup:  Mobile TestingUber Mobility Meetup:  Mobile Testing
Uber Mobility Meetup: Mobile TestingApple Chow
 
Tips to achieve continuous integration/delivery using HP ALM, Jenkins, and S...
 Tips to achieve continuous integration/delivery using HP ALM, Jenkins, and S... Tips to achieve continuous integration/delivery using HP ALM, Jenkins, and S...
Tips to achieve continuous integration/delivery using HP ALM, Jenkins, and S...Skytap Cloud
 
Serverless in production (O'Reilly Software Architecture)
Serverless in production (O'Reilly Software Architecture)Serverless in production (O'Reilly Software Architecture)
Serverless in production (O'Reilly Software Architecture)Yan Cui
 
Testing for infra code using test-kitchen,docker,chef
Testing for infra code using  test-kitchen,docker,chefTesting for infra code using  test-kitchen,docker,chef
Testing for infra code using test-kitchen,docker,chefkamalikamj
 
Anatomy of a Build Pipeline
Anatomy of a Build PipelineAnatomy of a Build Pipeline
Anatomy of a Build PipelineSamuel Brown
 
Taming Deployment With Smart Frog
Taming Deployment With Smart FrogTaming Deployment With Smart Frog
Taming Deployment With Smart FrogSteve Loughran
 
AWS Summit Auckland - Application Delivery Patterns for Developers
AWS Summit Auckland - Application Delivery Patterns for DevelopersAWS Summit Auckland - Application Delivery Patterns for Developers
AWS Summit Auckland - Application Delivery Patterns for DevelopersAmazon Web Services
 
API First Workflow: How could we have better API Docs through DevOps pipeline
API First Workflow: How could we have better API Docs through DevOps pipelineAPI First Workflow: How could we have better API Docs through DevOps pipeline
API First Workflow: How could we have better API Docs through DevOps pipelinePronovix
 
Integration Testing as Validation and Monitoring
 Integration Testing as Validation and Monitoring Integration Testing as Validation and Monitoring
Integration Testing as Validation and MonitoringMelissa Benua
 
Functional Testing Swing Applications with Frankenstein
Functional Testing Swing Applications with FrankensteinFunctional Testing Swing Applications with Frankenstein
Functional Testing Swing Applications with Frankensteinvivek_prahlad
 
Building Advanced Serverless Workflows with AWS Step Functions | AWS Floor28
Building Advanced Serverless Workflows with AWS Step Functions | AWS Floor28Building Advanced Serverless Workflows with AWS Step Functions | AWS Floor28
Building Advanced Serverless Workflows with AWS Step Functions | AWS Floor28Amazon Web Services
 
How's relevant JMeter to me - DevConf (Letterkenny)
How's relevant JMeter to me - DevConf (Letterkenny)How's relevant JMeter to me - DevConf (Letterkenny)
How's relevant JMeter to me - DevConf (Letterkenny)Giulio Vian
 
Cloud-powered Continuous Integration and Deployment architectures - Jinesh Varia
Cloud-powered Continuous Integration and Deployment architectures - Jinesh VariaCloud-powered Continuous Integration and Deployment architectures - Jinesh Varia
Cloud-powered Continuous Integration and Deployment architectures - Jinesh VariaAmazon Web Services
 
Containerised Testing at Demonware : PyCon Ireland 2016
Containerised Testing at Demonware : PyCon Ireland 2016Containerised Testing at Demonware : PyCon Ireland 2016
Containerised Testing at Demonware : PyCon Ireland 2016Thomas Shaw
 
Serverless in production, an experience report (microservices london)
Serverless in production, an experience report (microservices london)Serverless in production, an experience report (microservices london)
Serverless in production, an experience report (microservices london)Yan Cui
 
Resilience Testing
Resilience Testing Resilience Testing
Resilience Testing Ran Levy
 
Release with confidence
Release with confidenceRelease with confidence
Release with confidenceJohn Congdon
 
Modernizing Testing as Apps Re-Architect
Modernizing Testing as Apps Re-ArchitectModernizing Testing as Apps Re-Architect
Modernizing Testing as Apps Re-ArchitectDevOps.com
 

Ähnlich wie Testing distributed systems in production (20)

AWS Lambda from the trenches
AWS Lambda from the trenchesAWS Lambda from the trenches
AWS Lambda from the trenches
 
Uber Mobility Meetup: Mobile Testing
Uber Mobility Meetup:  Mobile TestingUber Mobility Meetup:  Mobile Testing
Uber Mobility Meetup: Mobile Testing
 
Tips to achieve continuous integration/delivery using HP ALM, Jenkins, and S...
 Tips to achieve continuous integration/delivery using HP ALM, Jenkins, and S... Tips to achieve continuous integration/delivery using HP ALM, Jenkins, and S...
Tips to achieve continuous integration/delivery using HP ALM, Jenkins, and S...
 
Serverless in production (O'Reilly Software Architecture)
Serverless in production (O'Reilly Software Architecture)Serverless in production (O'Reilly Software Architecture)
Serverless in production (O'Reilly Software Architecture)
 
Testing for infra code using test-kitchen,docker,chef
Testing for infra code using  test-kitchen,docker,chefTesting for infra code using  test-kitchen,docker,chef
Testing for infra code using test-kitchen,docker,chef
 
Anatomy of a Build Pipeline
Anatomy of a Build PipelineAnatomy of a Build Pipeline
Anatomy of a Build Pipeline
 
Taming Deployment With Smart Frog
Taming Deployment With Smart FrogTaming Deployment With Smart Frog
Taming Deployment With Smart Frog
 
Beyond Unit Testing
Beyond Unit TestingBeyond Unit Testing
Beyond Unit Testing
 
AWS Summit Auckland - Application Delivery Patterns for Developers
AWS Summit Auckland - Application Delivery Patterns for DevelopersAWS Summit Auckland - Application Delivery Patterns for Developers
AWS Summit Auckland - Application Delivery Patterns for Developers
 
API First Workflow: How could we have better API Docs through DevOps pipeline
API First Workflow: How could we have better API Docs through DevOps pipelineAPI First Workflow: How could we have better API Docs through DevOps pipeline
API First Workflow: How could we have better API Docs through DevOps pipeline
 
Integration Testing as Validation and Monitoring
 Integration Testing as Validation and Monitoring Integration Testing as Validation and Monitoring
Integration Testing as Validation and Monitoring
 
Functional Testing Swing Applications with Frankenstein
Functional Testing Swing Applications with FrankensteinFunctional Testing Swing Applications with Frankenstein
Functional Testing Swing Applications with Frankenstein
 
Building Advanced Serverless Workflows with AWS Step Functions | AWS Floor28
Building Advanced Serverless Workflows with AWS Step Functions | AWS Floor28Building Advanced Serverless Workflows with AWS Step Functions | AWS Floor28
Building Advanced Serverless Workflows with AWS Step Functions | AWS Floor28
 
How's relevant JMeter to me - DevConf (Letterkenny)
How's relevant JMeter to me - DevConf (Letterkenny)How's relevant JMeter to me - DevConf (Letterkenny)
How's relevant JMeter to me - DevConf (Letterkenny)
 
Cloud-powered Continuous Integration and Deployment architectures - Jinesh Varia
Cloud-powered Continuous Integration and Deployment architectures - Jinesh VariaCloud-powered Continuous Integration and Deployment architectures - Jinesh Varia
Cloud-powered Continuous Integration and Deployment architectures - Jinesh Varia
 
Containerised Testing at Demonware : PyCon Ireland 2016
Containerised Testing at Demonware : PyCon Ireland 2016Containerised Testing at Demonware : PyCon Ireland 2016
Containerised Testing at Demonware : PyCon Ireland 2016
 
Serverless in production, an experience report (microservices london)
Serverless in production, an experience report (microservices london)Serverless in production, an experience report (microservices london)
Serverless in production, an experience report (microservices london)
 
Resilience Testing
Resilience Testing Resilience Testing
Resilience Testing
 
Release with confidence
Release with confidenceRelease with confidence
Release with confidence
 
Modernizing Testing as Apps Re-Architect
Modernizing Testing as Apps Re-ArchitectModernizing Testing as Apps Re-Architect
Modernizing Testing as Apps Re-Architect
 

Mehr von Paul Bakker

Migrating to java 9 modules
Migrating to java 9 modulesMigrating to java 9 modules
Migrating to java 9 modulesPaul Bakker
 
Kubernetes automation in production
Kubernetes automation in productionKubernetes automation in production
Kubernetes automation in productionPaul Bakker
 
Tutorial introduction to OSGi
Tutorial introduction to OSGiTutorial introduction to OSGi
Tutorial introduction to OSGiPaul Bakker
 
Lessons learned from a large scale OSGi web app
Lessons learned from a large scale OSGi web appLessons learned from a large scale OSGi web app
Lessons learned from a large scale OSGi web appPaul Bakker
 
Moduarlity patterns with OSGi
Moduarlity patterns with OSGiModuarlity patterns with OSGi
Moduarlity patterns with OSGiPaul Bakker
 

Mehr von Paul Bakker (6)

Migrating to java 9 modules
Migrating to java 9 modulesMigrating to java 9 modules
Migrating to java 9 modules
 
Kubernetes automation in production
Kubernetes automation in productionKubernetes automation in production
Kubernetes automation in production
 
Tutorial introduction to OSGi
Tutorial introduction to OSGiTutorial introduction to OSGi
Tutorial introduction to OSGi
 
Lessons learned from a large scale OSGi web app
Lessons learned from a large scale OSGi web appLessons learned from a large scale OSGi web app
Lessons learned from a large scale OSGi web app
 
Moduarlity patterns with OSGi
Moduarlity patterns with OSGiModuarlity patterns with OSGi
Moduarlity patterns with OSGi
 
Osgi cdi
Osgi cdiOsgi cdi
Osgi cdi
 

Kürzlich hochgeladen

Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsJhone kinadey
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsArshad QA
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdfWave PLM
 
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...soniya singh
 
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AISyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AIABDERRAOUF MEHENNI
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...MyIntelliSource, Inc.
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantAxelRicardoTrocheRiq
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comFatema Valibhai
 
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataAdobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataBradBedford3
 
Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)OPEN KNOWLEDGE GmbH
 
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...stazi3110
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...OnePlan Solutions
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software DevelopersVinodh Ram
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providermohitmore19
 
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️anilsa9823
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...MyIntelliSource, Inc.
 
DNT_Corporate presentation know about us
DNT_Corporate presentation know about usDNT_Corporate presentation know about us
DNT_Corporate presentation know about usDynamic Netsoft
 

Kürzlich hochgeladen (20)

Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial Goals
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview Questions
 
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS LiveVip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf
 
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
 
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AISyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
 
Exploring iOS App Development: Simplifying the Process
Exploring iOS App Development: Simplifying the ProcessExploring iOS App Development: Simplifying the Process
Exploring iOS App Development: Simplifying the Process
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service Consultant
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.com
 
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataAdobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
 
Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)
 
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software Developers
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
 
Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...Call Girls In Mukherjee Nagar 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
 
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
 
DNT_Corporate presentation know about us
DNT_Corporate presentation know about usDNT_Corporate presentation know about us
DNT_Corporate presentation know about us
 

Testing distributed systems in production

  • 1. Testing Distributed Systems in Production. |Paul Bakker @pbakker
  • 2. Paul Bakker Edge Developer Productivity @ Netflix Paul Bakker @pbakker
  • 3.
  • 4. Contents. Types of testing for micro services Simulation testing Simone example Simulation testing architecture Client libs vs grpc
  • 6. Types of testing Within each service Unit / Integration / Smoke testing Functional tests in a test environment Performance / squeeze testing Shadow traffic / Replay Canary Simulations in production Infra Failure Injection Testing Chaos engineering Failover/Evacuation exercises
  • 7. Wait, aren’t micro services suppose to be easy!?
  • 8. Test vs Prod environment Two separate AWS environments Test closely mimics Prod Smaller capacity Data is different (caches, customer data, etc.)
  • 9. In-process smoke tests. Bootstraps the service from a JUnit test All dependencies are real (test environment) Tests hit the in-process server on HTTP or grpc Service owners should spend a lot of time here
  • 10. In-process smoke tests. @Singleton @Path("v1/hello") public final class MemeTestingExamplesResource { /** Where we keep our greetings for each user. */ private final MemeTestingExamplesDao memeTestingExamplesDao; private final MemeTestingExamplesConfig config; @Inject public MemeTestingExamplesResource( MemeTestingExamplesDao memeTestingExamplesDao, MemeTestingExamplesConfig config, Registry registry) { this.memeTestingExamplesDao = memeTestingExamplesDao; this.config = config; } @Path("{user}") @GET @Produces({MediaType.APPLICATION_JSON}) public Greeting getGreeting(@PathParam("user") String userEmail) { return memeTestingExamplesDao.loadGreeting(userEmail).orElseGet( () -> { Greeting annonymousGreeting = new Greeting(); annonymousGreeting.setUserEmail(userEmail); annonymousGreeting.setFirstName(config.getDefaultAnonymousName()); annonymousGreeting.setMessage(config.getDefaultGreeting()); return annonymousGreeting; }); } @POST @Produces({MediaType.APPLICATION_JSON}) @Consumes({MediaType.APPLICATION_JSON}) public String setGreeting(Greeting greeting) { memeTestingExamplesDao.storeGreeting(greeting); return ""OK""; } } @RunWith(GovernatorJunit4ClassRunner.class) @ModulesForTesting({MemeTestingExamplesModule.class, Archaius2JettyModule.class}) @TestPropertyOverride(value={“governator.jetty.embedded.port=0"}, propertyFiles={"laptop.properties"}) public class SmokeTest { @Inject @Named("embeddedJettyPort") private int ephemeralPort; @Test public void testRestEndpoint() { given().port(ephemeralPort).log().ifValidationFails() .when() .get("/REST/v1/hello/n@n.com") .then() .assertThat().statusCode(200) .and() .body("userEmail", equalTo("n@n.com")); } } Service to test Test
  • 11. In-process smoke tests vs deployments. Faster to run Less moving parts (Jenkins, Spinnaker, AWS etc.) => Less flakiness Options for mocking some dependencies
  • 12. Functional and squeeze tests Validate service from perspective of service consumers Deploy to a test cluster Create a reference application that integrates with your service, using your client lib Run tests against reference app application Tests Reference App Service http / grpc http / grpc
  • 13. Shadow traffic Zuul Prod cluster Shadow cluster 100% 100% Send all traffic to a second cluster Shadow cluster drops responses, but generates metrics Good for performance testing, and high level correctness (e.g. error rate)
  • 14. Canaries Zuul Baseline cluster Canary cluster 90% 10% Send a percentage of traffic to a second cluster Track metrics to find issues compared to baseline This affects production traffic!
  • 15. Chaos and Failure Injection Testing Test failover and fallback scenarios Introduce failures or latency in the http/grpc layer Terminate instances Datastore failure/latency
  • 16. Region failover exercises Exercises the capability to fail out of a region E.g. what happens if an AWS region goes dark? Commonly exposes (minor) issues Make sure you can recover quickly!
  • 19. Simulation Testing End to end tests Device certification Content validation (e.g. fixes to subtitles) The device is unaware of any simulations How to externally trigger special behavior in a service?
  • 20. Simone ServerMicro service simone-client /REST/variants Kafka 2. Publish Variant to clients3. Receive Variant 6. Consume Test script 1. Create Variant Cassandra ElasticSearch Dynomite API 4. Start test 5. Check variants /REST/insights 7. Verify variant insights Variant storage Insights Simone architecture
  • 21. Simone Demo. Does a device behave correctly with different bit rates? Bitrates are adaptive, they change depending on bandwidth
  • 22. Simone ServerMicro service simone-client /REST/variants Kafka 2. Publish Variant to clients3. Receive Variant 6. Consume Test script 1. Create Variant Cassandra ElasticSearch Dynomite API 4. Start test 5. Check variants /REST/insights 7. Verify variant insights Variant storage Insights Simone architecture
  • 23. Who needs a test environment… When you can just test in prod!?
  • 24. Why run in prod!? Devices are unaware of tests They only know the real thing They can’t access internal systems Also, caching is hard…
  • 25. Other examples Testing license failures Testing “too many devices” Testing CDN overrides Forcing API errors
  • 26. SimulationResponse response = simoneClient.execute("com.netflix.okja.regressiontests.TestTemplate", Trigger.esnTrigger(request.getEsn()), getPassport(request.getCustomerId(), request.getEsn()), () -> SimulationResponse.newBuilder().setVariantApplied(false).setMessage("No variant found").build(), (ctx) -> SimulationResponse.newBuilder().setVariantApplied(true).setMessage("Variant applied").build(), (ctx) -> ctx.setDomainData(request.getDomainDataJson()) ); Simone client example Type of simulation to run How to trigger the simulation. E.g. by customerId, esn, viewableId… User for this request (can we pre-check for test users!?) Default handler, no simulation is found Simulation handler Post handler - Apply extra logging for insights
  • 27. Get out of the critical path! We’re embedded in most tier 1 services What if we mess up? Have really aggressive grpc timeouts Circuit breakers Pre-checks if we should run at all