SlideShare a Scribd company logo
1 of 18
Download to read offline
Reliability Patterns
for Large-scale
Selenium Tests
Waseem Hamshawi
Senior Automation Engineer, LivePerson
waseemh@liveperson.com
github.com/waseemh
linkedin.com/in/waseem-hamshawi
Liveperson transforms the connection between
brands and consumers
200BN
API calls
per month
7
Data
Centers
(worldwide)
6000
Virtual
Servers
3BN
Visits
Per month
25
Scenarios
350,000
Executions
per day
7
Data
Centers
(Geo-distributed)
70
Virtual
Machines
SYML
LO
AMS
VA
CA
Distributed Testing
Scalability vs Reliability
● Scale goes up → More deployments
● Minimize risk when modifying tests codebase
● Apply software deployment principals to test automation
Reliable Deployments
Pre-Staging Staging Production
(SSOT)
Failure rate > 3 % Failure rate > 3 %
Failure rate > 3 %
Rollout Rollout
● Multi-tier phased deployment
● Rollout criteria: failure rate < x% for [0,t] time range
● Feature Flags
● Rule of Thumb: External access points and APIs will fail
● Test code should be tolerance to external failures
● Provide Fallbacks to every access point
getRemoteWebDriver()
Primary
Grid
Secondary
Grid
getFallback()
If primary fail
Single Point of Failures
● Selenium Grid - Single point of failure
Secondary Hub/Grid failover
Single Point of Failures
getRemoteWebDriver()
Grid 1
Grid 2 new RemoteWebDriver()
getFallback()
If primary or secondary fail
Grid Load Balancing
Grid 3
Grid N
.
.
Load Balancer
● Breakdown large Grids into smaller ones
● Redundant, highly available Grid setup
● Monitor and load balance
● Open source LB: Ribbon (github.com/Netflix/ribbon)
Circuit Breakers
● Don’t beat a dead horse
● Prevent unnecessary timed-out requests
● Shed load on external access point
● Failure Handling Open source libraries:
○ Hystrix (github.com/Netflix/Hystrix)
○ Failsafe (github.com/jhalterman/failsafe)
Single Point of Failures
OPENCLOSED
HALF OPEN
fail [threshold reached]
Open Circuit timeout
reached
fail
success
success
Fallback
Hystrix Command - Example
Test
Test
Cluster-wide Distribution
VM
VM
VM
VM
Z1-us_east
VM
VM
VM
VM
Z2-eu_west
VM
VM
VM
VM
Z3-asia
VM
VM
VM
VM
Z4-us_west
VM
VM
Z5-eu_east
VM
VMTest
Test
Test
Test
Test
Test
Test
Cluster-wide Distribution
● Launch short-lived Selenium Standalone Server containers
Test
initRemoteWebdriverSession(caps)
Selenium
Container
VM
Selenium
Container
VM
Selenium
Container
VM
Selenium
Container
VM
new RemoteWebDriver(External Endpoint)
Cluster
Manager
● Deploy Selenium containers on-demand
● Let Cluster Manager do the distribution
● Scale is dependent only on cluster’s capacity
● Initialize RemoteWebDriver based on deployment endpoint (IP:Port)
A library for creating short-lived testing endpoints over container clusters
● Tests Integration - Programmatically launch test environment
● Plugable Cluster Management Systems
● Cluster-based Scaling
Ephemerals
Test
Container
VM
Cluster
Manager
Ephemerals
API
Container
VM
Container
VM
Container
VM
Deploy
External Endpointnew Object(External Endpoint)
LivePersonInc/ephem
erals
Container Orchestration using Google Container Engine (GKE) and Kubernetes
● Healthchecks (Liveness/Readiness Probes)
● Self-healing mechanisms
● Autoscaling
● Resource Monitoring
Use Case: GCP, Kubernetes and Docker
Test
Ephemerals
API
Deploy
External IP:4444RemoteWebDriver(External IP:4444)
getRemoteWebDriver
(capabilities)
@Rule
public EphemeralResource<RemoteWebDriver> seleniumResource =
new EphemeralResource(
new SeleniumEphemeral.Builder(deploymentContext)
.withDesiredCapabilities(FIREFOX_42)
.build());
@Test
public void test() {
RemoteWebDriver remoteWebDriver = seleniumResource.get();
.....
}
Ephemerals - JUnit Integration
DEMO
github.com/LivePersonInc/ephemerals
● Deploy safely, Just like your software
● No Assumptions - Failure Awareness
● Avoid or protect SPOFs
● Containerization - Short lived, throwaway instances
● Cluster-based Orchestration
● Cloud is the Future - also for Testing
Takeaways

More Related Content

What's hot

UEMB260: Provisioning: Under the Hood
UEMB260: Provisioning: Under the HoodUEMB260: Provisioning: Under the Hood
UEMB260: Provisioning: Under the HoodIvanti
 
Building a Production Grade PostgreSQL Cloud Foundry Service | anynines
Building a Production Grade PostgreSQL Cloud Foundry Service  | anyninesBuilding a Production Grade PostgreSQL Cloud Foundry Service  | anynines
Building a Production Grade PostgreSQL Cloud Foundry Service | anyninesanynines GmbH
 
Docker в автоматизации тестирования
Docker в автоматизации тестированияDocker в автоматизации тестирования
Docker в автоматизации тестированияCOMAQA.BY
 
Be flexible with zalenium, a dockerized selenium grid infrastructure
Be flexible with zalenium, a dockerized selenium grid infrastructureBe flexible with zalenium, a dockerized selenium grid infrastructure
Be flexible with zalenium, a dockerized selenium grid infrastructureGeorgios Romanas
 
Splunk conf2014 - Using Selenium and Splunk for Transaction Monitoring Insight
Splunk conf2014 - Using Selenium and Splunk for Transaction Monitoring InsightSplunk conf2014 - Using Selenium and Splunk for Transaction Monitoring Insight
Splunk conf2014 - Using Selenium and Splunk for Transaction Monitoring InsightSplunk
 
Maturing Locately Dev Processes
Maturing Locately Dev ProcessesMaturing Locately Dev Processes
Maturing Locately Dev Processesmpklein
 
Config Management Camp 2015 - How to Deploy CFEngine in the Open Internet
Config Management Camp 2015 - How to Deploy CFEngine in the Open InternetConfig Management Camp 2015 - How to Deploy CFEngine in the Open Internet
Config Management Camp 2015 - How to Deploy CFEngine in the Open InternetCFEngine
 
Cfg Mgmtcamp 2015 - Releases
Cfg Mgmtcamp 2015 - ReleasesCfg Mgmtcamp 2015 - Releases
Cfg Mgmtcamp 2015 - ReleasesCFEngine
 
Version Control and Continuous Integration
Version Control and Continuous IntegrationVersion Control and Continuous Integration
Version Control and Continuous IntegrationGeff Henderson Chang
 
Cypress e2e automation testing - day1 intor by: Hassan Hameed
Cypress e2e automation testing -  day1 intor by: Hassan HameedCypress e2e automation testing -  day1 intor by: Hassan Hameed
Cypress e2e automation testing - day1 intor by: Hassan HameedHassan Muhammad
 
Maven plugins, properties en profiles: Advanced concepts in Maven
Maven plugins, properties en profiles: Advanced concepts in MavenMaven plugins, properties en profiles: Advanced concepts in Maven
Maven plugins, properties en profiles: Advanced concepts in MavenGeert Pante
 
Introduction to monix coeval
Introduction to monix coevalIntroduction to monix coeval
Introduction to monix coevalKnoldus Inc.
 
Experience Report: Cloud Foundry Open Source Operations | anynines
Experience Report: Cloud Foundry Open Source Operations | anyninesExperience Report: Cloud Foundry Open Source Operations | anynines
Experience Report: Cloud Foundry Open Source Operations | anyninesanynines GmbH
 
Run tests at scale with on-demand Selenium Grid using AWS Fargate
Run tests at scale with on-demand Selenium Grid using AWS FargateRun tests at scale with on-demand Selenium Grid using AWS Fargate
Run tests at scale with on-demand Selenium Grid using AWS FargateMegha Mehta
 

What's hot (20)

UEMB260: Provisioning: Under the Hood
UEMB260: Provisioning: Under the HoodUEMB260: Provisioning: Under the Hood
UEMB260: Provisioning: Under the Hood
 
Building a Production Grade PostgreSQL Cloud Foundry Service | anynines
Building a Production Grade PostgreSQL Cloud Foundry Service  | anyninesBuilding a Production Grade PostgreSQL Cloud Foundry Service  | anynines
Building a Production Grade PostgreSQL Cloud Foundry Service | anynines
 
selenium grid & docker
selenium grid & dockerselenium grid & docker
selenium grid & docker
 
Docker в автоматизации тестирования
Docker в автоматизации тестированияDocker в автоматизации тестирования
Docker в автоматизации тестирования
 
Be flexible with zalenium, a dockerized selenium grid infrastructure
Be flexible with zalenium, a dockerized selenium grid infrastructureBe flexible with zalenium, a dockerized selenium grid infrastructure
Be flexible with zalenium, a dockerized selenium grid infrastructure
 
Splunk conf2014 - Using Selenium and Splunk for Transaction Monitoring Insight
Splunk conf2014 - Using Selenium and Splunk for Transaction Monitoring InsightSplunk conf2014 - Using Selenium and Splunk for Transaction Monitoring Insight
Splunk conf2014 - Using Selenium and Splunk for Transaction Monitoring Insight
 
Maturing Locately Dev Processes
Maturing Locately Dev ProcessesMaturing Locately Dev Processes
Maturing Locately Dev Processes
 
Config Management Camp 2015 - How to Deploy CFEngine in the Open Internet
Config Management Camp 2015 - How to Deploy CFEngine in the Open InternetConfig Management Camp 2015 - How to Deploy CFEngine in the Open Internet
Config Management Camp 2015 - How to Deploy CFEngine in the Open Internet
 
Cfg Mgmtcamp 2015 - Releases
Cfg Mgmtcamp 2015 - ReleasesCfg Mgmtcamp 2015 - Releases
Cfg Mgmtcamp 2015 - Releases
 
SVN Best Practices
SVN Best PracticesSVN Best Practices
SVN Best Practices
 
Version Control and Continuous Integration
Version Control and Continuous IntegrationVersion Control and Continuous Integration
Version Control and Continuous Integration
 
FV04_MostoviczT_RAD
FV04_MostoviczT_RADFV04_MostoviczT_RAD
FV04_MostoviczT_RAD
 
Jenkins presentation
Jenkins presentationJenkins presentation
Jenkins presentation
 
Cypress e2e automation testing - day1 intor by: Hassan Hameed
Cypress e2e automation testing -  day1 intor by: Hassan HameedCypress e2e automation testing -  day1 intor by: Hassan Hameed
Cypress e2e automation testing - day1 intor by: Hassan Hameed
 
Maven and ANT
Maven and ANTMaven and ANT
Maven and ANT
 
Prometheus workshop
Prometheus workshopPrometheus workshop
Prometheus workshop
 
Maven plugins, properties en profiles: Advanced concepts in Maven
Maven plugins, properties en profiles: Advanced concepts in MavenMaven plugins, properties en profiles: Advanced concepts in Maven
Maven plugins, properties en profiles: Advanced concepts in Maven
 
Introduction to monix coeval
Introduction to monix coevalIntroduction to monix coeval
Introduction to monix coeval
 
Experience Report: Cloud Foundry Open Source Operations | anynines
Experience Report: Cloud Foundry Open Source Operations | anyninesExperience Report: Cloud Foundry Open Source Operations | anynines
Experience Report: Cloud Foundry Open Source Operations | anynines
 
Run tests at scale with on-demand Selenium Grid using AWS Fargate
Run tests at scale with on-demand Selenium Grid using AWS FargateRun tests at scale with on-demand Selenium Grid using AWS Fargate
Run tests at scale with on-demand Selenium Grid using AWS Fargate
 

Similar to Reliability Patterns for Large-Scale Automated Tests

Kubernetes your tests! automation with docker on google cloud platform
Kubernetes your tests! automation with docker on google cloud platformKubernetes your tests! automation with docker on google cloud platform
Kubernetes your tests! automation with docker on google cloud platformLivePerson
 
Cloud-based performance testing
Cloud-based performance testingCloud-based performance testing
Cloud-based performance testingabhinavm
 
Resilience Testing
Resilience Testing Resilience Testing
Resilience Testing Ran Levy
 
Introduction to Selenium grid
Introduction to Selenium gridIntroduction to Selenium grid
Introduction to Selenium gridKnoldus Inc.
 
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
 
Salesforce selenium-saucelabs-webinar-april-2014
Salesforce selenium-saucelabs-webinar-april-2014Salesforce selenium-saucelabs-webinar-april-2014
Salesforce selenium-saucelabs-webinar-april-2014Sauce Labs
 
Automating development-operations-v1
Automating development-operations-v1Automating development-operations-v1
Automating development-operations-v1Sumanth Vepa
 
Automated Testing using JavaScript
Automated Testing using JavaScriptAutomated Testing using JavaScript
Automated Testing using JavaScriptSimon Guest
 
[FullStack NYC 2019] Effective Unit Tests for JavaScript
[FullStack NYC 2019] Effective Unit Tests for JavaScript[FullStack NYC 2019] Effective Unit Tests for JavaScript
[FullStack NYC 2019] Effective Unit Tests for JavaScriptHazem Saleh
 
Docker–Grid (A On demand and Scalable dockerized selenium grid architecture)
Docker–Grid (A On demand and Scalable dockerized selenium grid architecture)Docker–Grid (A On demand and Scalable dockerized selenium grid architecture)
Docker–Grid (A On demand and Scalable dockerized selenium grid architecture)STePINForum
 
Automated Virtualized Testing (AVT) with Docker, Kubernetes, WireMock and Gat...
Automated Virtualized Testing (AVT) with Docker, Kubernetes, WireMock and Gat...Automated Virtualized Testing (AVT) with Docker, Kubernetes, WireMock and Gat...
Automated Virtualized Testing (AVT) with Docker, Kubernetes, WireMock and Gat...VMware Tanzu
 
Mastering selenium for automated acceptance tests
Mastering selenium for automated acceptance testsMastering selenium for automated acceptance tests
Mastering selenium for automated acceptance testsNick Belhomme
 
VMworld 2013: Virtualizing and Tuning Large Scale Java Platforms
VMworld 2013: Virtualizing and Tuning Large Scale Java Platforms VMworld 2013: Virtualizing and Tuning Large Scale Java Platforms
VMworld 2013: Virtualizing and Tuning Large Scale Java Platforms VMworld
 
V mware v fabric 5 - what's new technical sales training presentation
V mware v fabric 5 - what's new technical sales training presentationV mware v fabric 5 - what's new technical sales training presentation
V mware v fabric 5 - what's new technical sales training presentationsolarisyourep
 
Designing apps for resiliency
Designing apps for resiliencyDesigning apps for resiliency
Designing apps for resiliencyMasashi Narumoto
 
selenium meetup sf talk march 2014 Selenium at Scale
selenium meetup sf talk march 2014 Selenium at Scaleselenium meetup sf talk march 2014 Selenium at Scale
selenium meetup sf talk march 2014 Selenium at ScaleDavid Louvton
 

Similar to Reliability Patterns for Large-Scale Automated Tests (20)

Kubernetes your tests! automation with docker on google cloud platform
Kubernetes your tests! automation with docker on google cloud platformKubernetes your tests! automation with docker on google cloud platform
Kubernetes your tests! automation with docker on google cloud platform
 
Cloud-based performance testing
Cloud-based performance testingCloud-based performance testing
Cloud-based performance testing
 
Resilience Testing
Resilience Testing Resilience Testing
Resilience Testing
 
Introduction to Selenium grid
Introduction to Selenium gridIntroduction to Selenium grid
Introduction to Selenium grid
 
Integration Testing as Validation and Monitoring
 Integration Testing as Validation and Monitoring Integration Testing as Validation and Monitoring
Integration Testing as Validation and Monitoring
 
Selenium at Salesforce Scale
Selenium at Salesforce ScaleSelenium at Salesforce Scale
Selenium at Salesforce Scale
 
Salesforce selenium-saucelabs-webinar-april-2014
Salesforce selenium-saucelabs-webinar-april-2014Salesforce selenium-saucelabs-webinar-april-2014
Salesforce selenium-saucelabs-webinar-april-2014
 
Automating development-operations-v1
Automating development-operations-v1Automating development-operations-v1
Automating development-operations-v1
 
Automated Testing using JavaScript
Automated Testing using JavaScriptAutomated Testing using JavaScript
Automated Testing using JavaScript
 
[FullStack NYC 2019] Effective Unit Tests for JavaScript
[FullStack NYC 2019] Effective Unit Tests for JavaScript[FullStack NYC 2019] Effective Unit Tests for JavaScript
[FullStack NYC 2019] Effective Unit Tests for JavaScript
 
Docker–Grid (A On demand and Scalable dockerized selenium grid architecture)
Docker–Grid (A On demand and Scalable dockerized selenium grid architecture)Docker–Grid (A On demand and Scalable dockerized selenium grid architecture)
Docker–Grid (A On demand and Scalable dockerized selenium grid architecture)
 
Automated Virtualized Testing (AVT) with Docker, Kubernetes, WireMock and Gat...
Automated Virtualized Testing (AVT) with Docker, Kubernetes, WireMock and Gat...Automated Virtualized Testing (AVT) with Docker, Kubernetes, WireMock and Gat...
Automated Virtualized Testing (AVT) with Docker, Kubernetes, WireMock and Gat...
 
Mastering selenium for automated acceptance tests
Mastering selenium for automated acceptance testsMastering selenium for automated acceptance tests
Mastering selenium for automated acceptance tests
 
VMworld 2013: Virtualizing and Tuning Large Scale Java Platforms
VMworld 2013: Virtualizing and Tuning Large Scale Java Platforms VMworld 2013: Virtualizing and Tuning Large Scale Java Platforms
VMworld 2013: Virtualizing and Tuning Large Scale Java Platforms
 
V mware v fabric 5 - what's new technical sales training presentation
V mware v fabric 5 - what's new technical sales training presentationV mware v fabric 5 - what's new technical sales training presentation
V mware v fabric 5 - what's new technical sales training presentation
 
Weblogic cluster
Weblogic clusterWeblogic cluster
Weblogic cluster
 
Weblogic cluster
Weblogic clusterWeblogic cluster
Weblogic cluster
 
Designing apps for resiliency
Designing apps for resiliencyDesigning apps for resiliency
Designing apps for resiliency
 
selenium meetup sf talk march 2014 Selenium at Scale
selenium meetup sf talk march 2014 Selenium at Scaleselenium meetup sf talk march 2014 Selenium at Scale
selenium meetup sf talk march 2014 Selenium at Scale
 
05 test infrastructure
05   test infrastructure05   test infrastructure
05 test infrastructure
 

Recently uploaded

eSoftTools IMAP Backup Software and migration tools
eSoftTools IMAP Backup Software and migration toolseSoftTools IMAP Backup Software and migration tools
eSoftTools IMAP Backup Software and migration toolsosttopstonverter
 
Exploring Selenium_Appium Frameworks for Seamless Integration with HeadSpin.pdf
Exploring Selenium_Appium Frameworks for Seamless Integration with HeadSpin.pdfExploring Selenium_Appium Frameworks for Seamless Integration with HeadSpin.pdf
Exploring Selenium_Appium Frameworks for Seamless Integration with HeadSpin.pdfkalichargn70th171
 
2024 DevNexus Patterns for Resiliency: Shuffle shards
2024 DevNexus Patterns for Resiliency: Shuffle shards2024 DevNexus Patterns for Resiliency: Shuffle shards
2024 DevNexus Patterns for Resiliency: Shuffle shardsChristopher Curtin
 
Tech Tuesday Slides - Introduction to Project Management with OnePlan's Work ...
Tech Tuesday Slides - Introduction to Project Management with OnePlan's Work ...Tech Tuesday Slides - Introduction to Project Management with OnePlan's Work ...
Tech Tuesday Slides - Introduction to Project Management with OnePlan's Work ...OnePlan Solutions
 
Strategies for using alternative queries to mitigate zero results
Strategies for using alternative queries to mitigate zero resultsStrategies for using alternative queries to mitigate zero results
Strategies for using alternative queries to mitigate zero resultsJean Silva
 
Effectively Troubleshoot 9 Types of OutOfMemoryError
Effectively Troubleshoot 9 Types of OutOfMemoryErrorEffectively Troubleshoot 9 Types of OutOfMemoryError
Effectively Troubleshoot 9 Types of OutOfMemoryErrorTier1 app
 
Ronisha Informatics Private Limited Catalogue
Ronisha Informatics Private Limited CatalogueRonisha Informatics Private Limited Catalogue
Ronisha Informatics Private Limited Catalogueitservices996
 
UI5ers live - Custom Controls wrapping 3rd-party libs.pptx
UI5ers live - Custom Controls wrapping 3rd-party libs.pptxUI5ers live - Custom Controls wrapping 3rd-party libs.pptx
UI5ers live - Custom Controls wrapping 3rd-party libs.pptxAndreas Kunz
 
Amazon Bedrock in Action - presentation of the Bedrock's capabilities
Amazon Bedrock in Action - presentation of the Bedrock's capabilitiesAmazon Bedrock in Action - presentation of the Bedrock's capabilities
Amazon Bedrock in Action - presentation of the Bedrock's capabilitiesKrzysztofKkol1
 
SensoDat: Simulation-based Sensor Dataset of Self-driving Cars
SensoDat: Simulation-based Sensor Dataset of Self-driving CarsSensoDat: Simulation-based Sensor Dataset of Self-driving Cars
SensoDat: Simulation-based Sensor Dataset of Self-driving CarsChristian Birchler
 
Leveraging AI for Mobile App Testing on Real Devices | Applitools + Kobiton
Leveraging AI for Mobile App Testing on Real Devices | Applitools + KobitonLeveraging AI for Mobile App Testing on Real Devices | Applitools + Kobiton
Leveraging AI for Mobile App Testing on Real Devices | Applitools + KobitonApplitools
 
Machine Learning Software Engineering Patterns and Their Engineering
Machine Learning Software Engineering Patterns and Their EngineeringMachine Learning Software Engineering Patterns and Their Engineering
Machine Learning Software Engineering Patterns and Their EngineeringHironori Washizaki
 
Odoo 14 - eLearning Module In Odoo 14 Enterprise
Odoo 14 - eLearning Module In Odoo 14 EnterpriseOdoo 14 - eLearning Module In Odoo 14 Enterprise
Odoo 14 - eLearning Module In Odoo 14 Enterprisepreethippts
 
Salesforce Implementation Services PPT By ABSYZ
Salesforce Implementation Services PPT By ABSYZSalesforce Implementation Services PPT By ABSYZ
Salesforce Implementation Services PPT By ABSYZABSYZ Inc
 
VictoriaMetrics Q1 Meet Up '24 - Community & News Update
VictoriaMetrics Q1 Meet Up '24 - Community & News UpdateVictoriaMetrics Q1 Meet Up '24 - Community & News Update
VictoriaMetrics Q1 Meet Up '24 - Community & News UpdateVictoriaMetrics
 
SAM Training Session - How to use EXCEL ?
SAM Training Session - How to use EXCEL ?SAM Training Session - How to use EXCEL ?
SAM Training Session - How to use EXCEL ?Alexandre Beguel
 
VictoriaMetrics Anomaly Detection Updates: Q1 2024
VictoriaMetrics Anomaly Detection Updates: Q1 2024VictoriaMetrics Anomaly Detection Updates: Q1 2024
VictoriaMetrics Anomaly Detection Updates: Q1 2024VictoriaMetrics
 
How to submit a standout Adobe Champion Application
How to submit a standout Adobe Champion ApplicationHow to submit a standout Adobe Champion Application
How to submit a standout Adobe Champion ApplicationBradBedford3
 
Sending Calendar Invites on SES and Calendarsnack.pdf
Sending Calendar Invites on SES and Calendarsnack.pdfSending Calendar Invites on SES and Calendarsnack.pdf
Sending Calendar Invites on SES and Calendarsnack.pdf31events.com
 
Patterns for automating API delivery. API conference
Patterns for automating API delivery. API conferencePatterns for automating API delivery. API conference
Patterns for automating API delivery. API conferencessuser9e7c64
 

Recently uploaded (20)

eSoftTools IMAP Backup Software and migration tools
eSoftTools IMAP Backup Software and migration toolseSoftTools IMAP Backup Software and migration tools
eSoftTools IMAP Backup Software and migration tools
 
Exploring Selenium_Appium Frameworks for Seamless Integration with HeadSpin.pdf
Exploring Selenium_Appium Frameworks for Seamless Integration with HeadSpin.pdfExploring Selenium_Appium Frameworks for Seamless Integration with HeadSpin.pdf
Exploring Selenium_Appium Frameworks for Seamless Integration with HeadSpin.pdf
 
2024 DevNexus Patterns for Resiliency: Shuffle shards
2024 DevNexus Patterns for Resiliency: Shuffle shards2024 DevNexus Patterns for Resiliency: Shuffle shards
2024 DevNexus Patterns for Resiliency: Shuffle shards
 
Tech Tuesday Slides - Introduction to Project Management with OnePlan's Work ...
Tech Tuesday Slides - Introduction to Project Management with OnePlan's Work ...Tech Tuesday Slides - Introduction to Project Management with OnePlan's Work ...
Tech Tuesday Slides - Introduction to Project Management with OnePlan's Work ...
 
Strategies for using alternative queries to mitigate zero results
Strategies for using alternative queries to mitigate zero resultsStrategies for using alternative queries to mitigate zero results
Strategies for using alternative queries to mitigate zero results
 
Effectively Troubleshoot 9 Types of OutOfMemoryError
Effectively Troubleshoot 9 Types of OutOfMemoryErrorEffectively Troubleshoot 9 Types of OutOfMemoryError
Effectively Troubleshoot 9 Types of OutOfMemoryError
 
Ronisha Informatics Private Limited Catalogue
Ronisha Informatics Private Limited CatalogueRonisha Informatics Private Limited Catalogue
Ronisha Informatics Private Limited Catalogue
 
UI5ers live - Custom Controls wrapping 3rd-party libs.pptx
UI5ers live - Custom Controls wrapping 3rd-party libs.pptxUI5ers live - Custom Controls wrapping 3rd-party libs.pptx
UI5ers live - Custom Controls wrapping 3rd-party libs.pptx
 
Amazon Bedrock in Action - presentation of the Bedrock's capabilities
Amazon Bedrock in Action - presentation of the Bedrock's capabilitiesAmazon Bedrock in Action - presentation of the Bedrock's capabilities
Amazon Bedrock in Action - presentation of the Bedrock's capabilities
 
SensoDat: Simulation-based Sensor Dataset of Self-driving Cars
SensoDat: Simulation-based Sensor Dataset of Self-driving CarsSensoDat: Simulation-based Sensor Dataset of Self-driving Cars
SensoDat: Simulation-based Sensor Dataset of Self-driving Cars
 
Leveraging AI for Mobile App Testing on Real Devices | Applitools + Kobiton
Leveraging AI for Mobile App Testing on Real Devices | Applitools + KobitonLeveraging AI for Mobile App Testing on Real Devices | Applitools + Kobiton
Leveraging AI for Mobile App Testing on Real Devices | Applitools + Kobiton
 
Machine Learning Software Engineering Patterns and Their Engineering
Machine Learning Software Engineering Patterns and Their EngineeringMachine Learning Software Engineering Patterns and Their Engineering
Machine Learning Software Engineering Patterns and Their Engineering
 
Odoo 14 - eLearning Module In Odoo 14 Enterprise
Odoo 14 - eLearning Module In Odoo 14 EnterpriseOdoo 14 - eLearning Module In Odoo 14 Enterprise
Odoo 14 - eLearning Module In Odoo 14 Enterprise
 
Salesforce Implementation Services PPT By ABSYZ
Salesforce Implementation Services PPT By ABSYZSalesforce Implementation Services PPT By ABSYZ
Salesforce Implementation Services PPT By ABSYZ
 
VictoriaMetrics Q1 Meet Up '24 - Community & News Update
VictoriaMetrics Q1 Meet Up '24 - Community & News UpdateVictoriaMetrics Q1 Meet Up '24 - Community & News Update
VictoriaMetrics Q1 Meet Up '24 - Community & News Update
 
SAM Training Session - How to use EXCEL ?
SAM Training Session - How to use EXCEL ?SAM Training Session - How to use EXCEL ?
SAM Training Session - How to use EXCEL ?
 
VictoriaMetrics Anomaly Detection Updates: Q1 2024
VictoriaMetrics Anomaly Detection Updates: Q1 2024VictoriaMetrics Anomaly Detection Updates: Q1 2024
VictoriaMetrics Anomaly Detection Updates: Q1 2024
 
How to submit a standout Adobe Champion Application
How to submit a standout Adobe Champion ApplicationHow to submit a standout Adobe Champion Application
How to submit a standout Adobe Champion Application
 
Sending Calendar Invites on SES and Calendarsnack.pdf
Sending Calendar Invites on SES and Calendarsnack.pdfSending Calendar Invites on SES and Calendarsnack.pdf
Sending Calendar Invites on SES and Calendarsnack.pdf
 
Patterns for automating API delivery. API conference
Patterns for automating API delivery. API conferencePatterns for automating API delivery. API conference
Patterns for automating API delivery. API conference
 

Reliability Patterns for Large-Scale Automated Tests

  • 2. Waseem Hamshawi Senior Automation Engineer, LivePerson waseemh@liveperson.com github.com/waseemh linkedin.com/in/waseem-hamshawi
  • 3. Liveperson transforms the connection between brands and consumers 200BN API calls per month 7 Data Centers (worldwide) 6000 Virtual Servers 3BN Visits Per month
  • 6. ● Scale goes up → More deployments ● Minimize risk when modifying tests codebase ● Apply software deployment principals to test automation Reliable Deployments Pre-Staging Staging Production (SSOT) Failure rate > 3 % Failure rate > 3 % Failure rate > 3 % Rollout Rollout ● Multi-tier phased deployment ● Rollout criteria: failure rate < x% for [0,t] time range ● Feature Flags
  • 7. ● Rule of Thumb: External access points and APIs will fail ● Test code should be tolerance to external failures ● Provide Fallbacks to every access point getRemoteWebDriver() Primary Grid Secondary Grid getFallback() If primary fail Single Point of Failures ● Selenium Grid - Single point of failure Secondary Hub/Grid failover
  • 8. Single Point of Failures getRemoteWebDriver() Grid 1 Grid 2 new RemoteWebDriver() getFallback() If primary or secondary fail Grid Load Balancing Grid 3 Grid N . . Load Balancer ● Breakdown large Grids into smaller ones ● Redundant, highly available Grid setup ● Monitor and load balance ● Open source LB: Ribbon (github.com/Netflix/ribbon)
  • 9. Circuit Breakers ● Don’t beat a dead horse ● Prevent unnecessary timed-out requests ● Shed load on external access point ● Failure Handling Open source libraries: ○ Hystrix (github.com/Netflix/Hystrix) ○ Failsafe (github.com/jhalterman/failsafe) Single Point of Failures OPENCLOSED HALF OPEN fail [threshold reached] Open Circuit timeout reached fail success success Fallback
  • 10. Hystrix Command - Example
  • 12. Cluster-wide Distribution ● Launch short-lived Selenium Standalone Server containers Test initRemoteWebdriverSession(caps) Selenium Container VM Selenium Container VM Selenium Container VM Selenium Container VM new RemoteWebDriver(External Endpoint) Cluster Manager ● Deploy Selenium containers on-demand ● Let Cluster Manager do the distribution ● Scale is dependent only on cluster’s capacity ● Initialize RemoteWebDriver based on deployment endpoint (IP:Port)
  • 13. A library for creating short-lived testing endpoints over container clusters ● Tests Integration - Programmatically launch test environment ● Plugable Cluster Management Systems ● Cluster-based Scaling Ephemerals Test Container VM Cluster Manager Ephemerals API Container VM Container VM Container VM Deploy External Endpointnew Object(External Endpoint) LivePersonInc/ephem erals
  • 14. Container Orchestration using Google Container Engine (GKE) and Kubernetes ● Healthchecks (Liveness/Readiness Probes) ● Self-healing mechanisms ● Autoscaling ● Resource Monitoring Use Case: GCP, Kubernetes and Docker Test Ephemerals API Deploy External IP:4444RemoteWebDriver(External IP:4444) getRemoteWebDriver (capabilities)
  • 15. @Rule public EphemeralResource<RemoteWebDriver> seleniumResource = new EphemeralResource( new SeleniumEphemeral.Builder(deploymentContext) .withDesiredCapabilities(FIREFOX_42) .build()); @Test public void test() { RemoteWebDriver remoteWebDriver = seleniumResource.get(); ..... } Ephemerals - JUnit Integration
  • 16. DEMO
  • 18. ● Deploy safely, Just like your software ● No Assumptions - Failure Awareness ● Avoid or protect SPOFs ● Containerization - Short lived, throwaway instances ● Cluster-based Orchestration ● Cloud is the Future - also for Testing Takeaways