SlideShare a Scribd company logo
1 of 35
PRESENTED BY
Resilient Testing at Scale
using Redis Queues
to Manage Concurrency
Aaron Evans
Sauce Labs, Solutions Architect
PRESENTED BY
1 Test Automation with Selenium & Sauce Labs
Agenda
2 How to implement a queue to manage concurrency
3 Redis data types (STRING, LIST, SET, HASH, ZSET)
4 Notifications with PUBLISH / SUBSCRIBE
5 Using RedisJSON to store complex data (test results)
6 Analyzing historical data with RediSearch
7 Predicting test failures with machine learning
PRESENTED BY
• My name is Aaron Evans
• Accidental software tester
• Burned out and went to Fiji to live on the beach
• Came back to buy a sailboat but got married instead
• Moved to Ecuador and started freelance consulting
• Traveled around the USA with my family in an RV
• Live in Montana on a farm in the woods & built a yurt
About me
PRESENTED BY
• Sauce Labs is a testing infrastructure company
• Founded by creator of Selenium, Jason Huggins
• Allows you to run test automation in the cloud on different OS, browsers & mobile
devices
• Using Selenium & Appium
• Essentially a managed remote Selenium grid
• Also provides a nice UI, dashboard, reports, manual testing via remote control, and
test archives & analytics
About Sauce Labs
PRESENTED BY
• Many tests run in parallel
• Need to manage test concurrency
• Across multiple teams & users
• Triggered by CI server or manually by developers
• Flaky / Slow Tests
• Analysis & Prediction
The Problem
PRESENTED BY
• Use Redis as a single source of truth
• Keep track of how many tests are running
• Create a "pool" of sessions
• Move from pending, to active, to complete
– Like a ledger
• Check out a session at the start of each test
• Check in when complete
• Store test data in Redis for future analysis
A Solution
PRESENTED BY
• KEY/VALUE store
– Memcached, Berkeley DB
• Relational database
– MySQL, PostgreSQL, Oracle
• NoSQL database / document store
– MongoDB, Cassandra
• Shared File System
– NFS, SMB
• Web Service
Alternatives to Redis
PRESENTED BY
• It’s fast!
• Simple API with available client for all major platforms
• Nice middle ground between Key/Value and NoSQL
• I didn’t want the hassle of setting up hosting or managing infrastructure
• Redis Labs has a free service tier that is sufficient
• I wanted to learn something new
Why Redis
PRESENTED BY
Implementation
PRESENTED BY
• Use a STRING to keep a count of concurrent sessions
• Numeric values can be incremented/decremented
• Subtract from counter when each session starts
• Add to counter after each session finishes
Keep track of available sessions with a counter
PRESENTED BY
String operations for simple counter
redis.test:6379>setavailable_sessions 100
OK
redis.test:6379>GETavailable_sessions
"100"
redis.test:6379>DECRavailable_sessions
(integer) 99
redis.test:6379>INCRavailable_sessions
(integer) 100
redis.test:6379>DECRBYavailable_sessions50
(integer) 50
redis.test:6379>INCRBYavailable_sessions25
(integer) 75
redis.test:6379>GETSETavailable_sessions 150
"75"
PRESENTED BY
• Add session_id to LIST when started
• Remove session_id from LIST when complete
• Get length of active_sessions to make sure you don’t exceed concurrency
• Trim sessions to appropriate size for cleanup
Create a LIST of active sessions
PRESENTED BY
List operations for active sessions
redis.test:6379>LPUSHactive_sessions session:123
(integer) 1
redis.test:6379>LPUSHactive_sessions session:124
(integer) 2
redis.test:6379>LPUSHactive_sessions session:125
(integer) 3
redis.test:6379>LREMactive_sessions 1 session:124
(integer) 1
redis.test:6379>LLENactive_sessions
(integer) 2
redis.test:6379>LRANGEactive_sessions 0 -1
1) "session:125"
2) "session:123"
redis.test:6379>LTRIMactive_sessions 0 99
OK
PRESENTED BY
• Use a separate list for requested test sessions
• First In / First Out (FIFO) queue
• LPUSH when a test session is requested
• RPOP when an active session becomes available
• RPUSHLPOP to atomically push from pending to active
Create a queue of pending tests
PRESENTED BY
List operations for requested sessions queue
redis.test:6379>LPUSHrequested_sessionsrequested:126
(integer) 1
redis.test:6379>LPUSHrequested_sessionsrequested:127
(integer) 2
redis.test:6379>RPOPrequested_sessions
"requested:126"
redis.test:6379>LPUSHactive_sessions session:126
(integer) 4
redis.test:6379>RPOPLPUSHrequested_sessions active_sessions
"requested:127"
redis.test:6379>LSETactive_sessions 0 session:127
OK
redis.test:6379>LRANGEactive_sessions 0 1
1) "session:127"
2) "session:126"
PRESENTED BY
Transaction for moving from requested to active session
redis.test:6379>MULTI
OK
redis.test:6379>LREMactive_sessions 1 session:126
QUEUED
redis.test:6379>BRPOPLPUSHrequested_sessionsactive_sessions 60
QUEUED
redis.test:6379>LSETactive_sessions 1 session:128
QUEUED
redis.test:6379>EXEC
1) (integer) 1
2) "requested:128"
3) OK
redis.test:6379>LINDEXactive_sessions 0
"session:128"
PRESENTED BY
• Notify client when sessions are available
• PUBLISH sends to all clients listening to channel
• SUBSCRIBE listens (may be blocking)
• Single worker publishes
• Avoids need for constant polling for available sessions
Notifications with PUBLISH / SUBSCRIBE
PRESENTED BY
PUBLISH / SUBSCRIBE operations
# CLIENTLISTENS
redis.test:6379>SUBSCRIBEsessions_available
Readingmessages...(pressCtrl-Ctoquit)
1) "subscribe"
2) "sessions_available"
3) (integer) 1
1) "message"
2) "sessions_available"
3) "requested:130"
# WORKERPUBLISHES
redis.test:6379>PUBLISHsessions_availablerequested:131
(integer) 1
PRESENTED BY
• Use a SET instead of a LIST
• Keys must be unique
• Sets aren’t ordered (no push / pop) * SPOP is random
• Ok because active_sessions are not necessarily in sequence
• Can move elements from one set to another
– (e.g. active to completed, passed, failed, errored)
• Allows grouping with SUNION, SINTER, SDIFF
• Can SORT if needed (and STORE as a list)
Avoid duplicate sessions with a SET
PRESENTED BY
Set operations for managing sessions
redis.test:6379>SADDactive_sessions session:123
(integer) 1
redis.test:6379>SADDactive_sessions session:123
(integer) 0
redis.test:6379>SCARDactive_sessions
(integer) 1
redis.test:6379>SMOVEactive_sessions completed_sessionssession:123
(integer) 1
redis.test:6379>SADDerrored_sessionssession:124
(integer) 1
redis.test:6379>SUNIONcompleted_sessions errored_sessions
1) "session:124"
2) "session:123"
PRESENTED BY
Move errored tests to retry queue
redis.test:6379>SMEMBERSerrored_sessions
1) "session:126"
2) "session:124"
3) "session:125”
redis.test:6379>SORTerrored_sessions ALPHASTOREretry_queue
(integer) 3
redis.test:6379>LRANGEretry_queue0 -1
1) "session:124"
2) "session:125"
3) "session:126”
PRESENTED BY
• Use a ZSET (Sorted Set)
• Combines the best features of both LIST and SET
– *but it comes at a cost
• Unique keys
• SCORE allows you to rank tests to specify priority
• POP elements by highest or lowest score
– ZPOPMAX / ZPOPMIN
Implement a priority queue with a sorted test
PRESENTED BY
ZSET commands for priority queue
redis.test:6379>ZADDpriority_queue1 session:1
(integer) 1
redis.test:6379>ZADDpriority_queue2 session:2
(integer) 1
redis.test:6379>ZINCRBYpriority_queue2 session:1
"3"
redis.test:6379>ZRANGEpriority_queue0 -1WITHSCORES
1) "session:2"
2) "2"
3) "session:1"
4) "3"
redis.test:6379>ZPOPMAX priority_queue
1) "session:1"
2) "3"
PRESENTED BY
• Store multiple Name/Value pairs
• Use session ID as HASH key
• Store test metadata
– Execution environment capabilities (e.g. OS, browser, version)
– Test name, build id, tags
– Test status (Passed/Failed, Completed/Errored)
Capture test data with a HASH
PRESENTED BY
Hash operations for storing test data
redis.test:6379>HSETsession:123name"login test"platform"Windows10"browser"IE"version "11"tag "regression"
(integer) 5
redis.test:6379>HEXISTSsession:123status
(integer) 0
redis.test:6379>HSETsession:123statuspassed
(integer) 0
redis.test:6379>HGETsession:123 status
"passed"
redis.test:6379>HGETALLsession:123
1) "name"
2) "login test"
…
11) "status"
12) "passed"
PRESENTED BY
• Hashes only store 1 dimension
• Can fake it with multipart keys
– foo.bar.baz=quux
• Use a common key between records for relationships
– testdata:{123}
– testresult:{123}
• Store as a JSON blob in a STRING
• Use Redis JSON
• Use Redis Search
Storing complex (hierarchical) test data
PRESENTED BY
• Additional Module
• Can be compiled or used with RedisLabs
• Allows for storing and querying JSON data
Using RedisJSON
PRESENTED BY
RedisJSON operations
redis.test:6379>JSON.SETsession:123. '{"name":"logintest","status":"failed"}'
OK
redis.test:6379>JSON.GETsession:123status
""failed""
PRESENTED BY
• Additional Module
• Can be compiled or use with RedisLabs
• Allows for full text search
• Numeric or Tags
• Add unstructured data
– Test steps
– Log files
– Error messages & stack traces
Using RediSearch
PRESENTED BY
RediSearch for test results
redis.test:6379>FT.CREATEtestresultsSCHEMA nameTEXTplatformTEXTbrowserTEXTversion TEXT exec_timeNUMERICstatusTAG
OK
redis.test:6379>FT.ADDtestresultstest:1231 FIELDSname"LoginTest"browser"Chrome"exec_time 123.456statusPASSED
OK
redis.test:6379>FT.SEARCHtestresultslogin
1) (integer) 1
2) "test:123"
3) 1) name
2) "LoginTest"
3) browser
4) "Chrome"
5) exec_time
6) "123.456"
PRESENTED BY
RediSearch for test results by status tag
redis.test:6379>FT.SEARCHtestresults"@status:{PASSED|COMPLETE}"
1) (integer) 1
2) "test:123"
3) 1) name
2) "LoginTest"
3) browser
4) "Chrome"
5) exec_time
6) "123.456"
7) status
8) "PASSED"
PRESENTED BY
• Finding patterns and anticipating failures
• Group By
– test failures
– platform / browser / device
– feature or tags
– release / over time series
– other data points that you can't predict
• Using Machine Learning
Looking forwards
Thank you!
PRESENTED BY
PRESENTED BY

More Related Content

What's hot

Integrated Cache on Netscaler
Integrated Cache on NetscalerIntegrated Cache on Netscaler
Integrated Cache on NetscalerMark Hillick
 
Serverspec and Sensu - Testing and Monitoring collide
Serverspec and Sensu - Testing and Monitoring collideServerspec and Sensu - Testing and Monitoring collide
Serverspec and Sensu - Testing and Monitoring collidem_richardson
 
Comparing ZooKeeper and Consul
Comparing ZooKeeper and ConsulComparing ZooKeeper and Consul
Comparing ZooKeeper and ConsulIvan Glushkov
 
OpenStack Austin Meetup January 2014: Chef + OpenStack
OpenStack Austin Meetup January 2014: Chef + OpenStackOpenStack Austin Meetup January 2014: Chef + OpenStack
OpenStack Austin Meetup January 2014: Chef + OpenStackMatt Ray
 
HadoopCon- Trend Micro SPN Hadoop Overview
HadoopCon- Trend Micro SPN Hadoop OverviewHadoopCon- Trend Micro SPN Hadoop Overview
HadoopCon- Trend Micro SPN Hadoop OverviewYafang Chang
 
Streamline Hadoop DevOps with Apache Ambari
Streamline Hadoop DevOps with Apache AmbariStreamline Hadoop DevOps with Apache Ambari
Streamline Hadoop DevOps with Apache AmbariAlejandro Fernandez
 
InSpec For DevOpsDays Amsterdam 2017
InSpec For DevOpsDays Amsterdam 2017InSpec For DevOpsDays Amsterdam 2017
InSpec For DevOpsDays Amsterdam 2017Mandi Walls
 
RAC+ASM: Stories to Share
RAC+ASM: Stories to ShareRAC+ASM: Stories to Share
RAC+ASM: Stories to Sharekutrovsky
 
Oracle Database Performance Tuning Concept
Oracle Database Performance Tuning ConceptOracle Database Performance Tuning Concept
Oracle Database Performance Tuning ConceptChien Chung Shen
 
Tuning Apache Ambari Performance for Big Data at Scale with 3,000 Agents
Tuning Apache Ambari Performance for Big Data at Scale with 3,000 AgentsTuning Apache Ambari Performance for Big Data at Scale with 3,000 Agents
Tuning Apache Ambari Performance for Big Data at Scale with 3,000 AgentsAlejandro Fernandez
 
Supercharging Content Delivery with Varnish
Supercharging Content Delivery with VarnishSupercharging Content Delivery with Varnish
Supercharging Content Delivery with VarnishSamantha Quiñones
 
Linux conna kpatch-without-stopmachine-fixed
Linux conna kpatch-without-stopmachine-fixedLinux conna kpatch-without-stopmachine-fixed
Linux conna kpatch-without-stopmachine-fixedTommy Lee
 
What is new in PostgreSQL 14?
What is new in PostgreSQL 14?What is new in PostgreSQL 14?
What is new in PostgreSQL 14?Mydbops
 
Elasticsearch for Logs & Metrics - a deep dive
Elasticsearch for Logs & Metrics - a deep diveElasticsearch for Logs & Metrics - a deep dive
Elasticsearch for Logs & Metrics - a deep diveSematext Group, Inc.
 
Arnold Bechtoldt, Inovex GmbH Linux systems engineer - Configuration Manageme...
Arnold Bechtoldt, Inovex GmbH Linux systems engineer - Configuration Manageme...Arnold Bechtoldt, Inovex GmbH Linux systems engineer - Configuration Manageme...
Arnold Bechtoldt, Inovex GmbH Linux systems engineer - Configuration Manageme...SaltStack
 
Kubernetes at Datadog Scale
Kubernetes at Datadog ScaleKubernetes at Datadog Scale
Kubernetes at Datadog ScaleDocker, Inc.
 
HIPAA Compliant Deployment of Apache Spark on AWS for Healthcare Nitin Panjwa...
HIPAA Compliant Deployment of Apache Spark on AWS for Healthcare Nitin Panjwa...HIPAA Compliant Deployment of Apache Spark on AWS for Healthcare Nitin Panjwa...
HIPAA Compliant Deployment of Apache Spark on AWS for Healthcare Nitin Panjwa...Databricks
 
So we're running Apache ZooKeeper. Now What? By Camille Fournier
So we're running Apache ZooKeeper. Now What? By Camille Fournier So we're running Apache ZooKeeper. Now What? By Camille Fournier
So we're running Apache ZooKeeper. Now What? By Camille Fournier Hakka Labs
 

What's hot (19)

Integrated Cache on Netscaler
Integrated Cache on NetscalerIntegrated Cache on Netscaler
Integrated Cache on Netscaler
 
Serverspec and Sensu - Testing and Monitoring collide
Serverspec and Sensu - Testing and Monitoring collideServerspec and Sensu - Testing and Monitoring collide
Serverspec and Sensu - Testing and Monitoring collide
 
Comparing ZooKeeper and Consul
Comparing ZooKeeper and ConsulComparing ZooKeeper and Consul
Comparing ZooKeeper and Consul
 
OpenStack Austin Meetup January 2014: Chef + OpenStack
OpenStack Austin Meetup January 2014: Chef + OpenStackOpenStack Austin Meetup January 2014: Chef + OpenStack
OpenStack Austin Meetup January 2014: Chef + OpenStack
 
HadoopCon- Trend Micro SPN Hadoop Overview
HadoopCon- Trend Micro SPN Hadoop OverviewHadoopCon- Trend Micro SPN Hadoop Overview
HadoopCon- Trend Micro SPN Hadoop Overview
 
Streamline Hadoop DevOps with Apache Ambari
Streamline Hadoop DevOps with Apache AmbariStreamline Hadoop DevOps with Apache Ambari
Streamline Hadoop DevOps with Apache Ambari
 
InSpec For DevOpsDays Amsterdam 2017
InSpec For DevOpsDays Amsterdam 2017InSpec For DevOpsDays Amsterdam 2017
InSpec For DevOpsDays Amsterdam 2017
 
How to Run Solr on Docker and Why
How to Run Solr on Docker and WhyHow to Run Solr on Docker and Why
How to Run Solr on Docker and Why
 
RAC+ASM: Stories to Share
RAC+ASM: Stories to ShareRAC+ASM: Stories to Share
RAC+ASM: Stories to Share
 
Oracle Database Performance Tuning Concept
Oracle Database Performance Tuning ConceptOracle Database Performance Tuning Concept
Oracle Database Performance Tuning Concept
 
Tuning Apache Ambari Performance for Big Data at Scale with 3,000 Agents
Tuning Apache Ambari Performance for Big Data at Scale with 3,000 AgentsTuning Apache Ambari Performance for Big Data at Scale with 3,000 Agents
Tuning Apache Ambari Performance for Big Data at Scale with 3,000 Agents
 
Supercharging Content Delivery with Varnish
Supercharging Content Delivery with VarnishSupercharging Content Delivery with Varnish
Supercharging Content Delivery with Varnish
 
Linux conna kpatch-without-stopmachine-fixed
Linux conna kpatch-without-stopmachine-fixedLinux conna kpatch-without-stopmachine-fixed
Linux conna kpatch-without-stopmachine-fixed
 
What is new in PostgreSQL 14?
What is new in PostgreSQL 14?What is new in PostgreSQL 14?
What is new in PostgreSQL 14?
 
Elasticsearch for Logs & Metrics - a deep dive
Elasticsearch for Logs & Metrics - a deep diveElasticsearch for Logs & Metrics - a deep dive
Elasticsearch for Logs & Metrics - a deep dive
 
Arnold Bechtoldt, Inovex GmbH Linux systems engineer - Configuration Manageme...
Arnold Bechtoldt, Inovex GmbH Linux systems engineer - Configuration Manageme...Arnold Bechtoldt, Inovex GmbH Linux systems engineer - Configuration Manageme...
Arnold Bechtoldt, Inovex GmbH Linux systems engineer - Configuration Manageme...
 
Kubernetes at Datadog Scale
Kubernetes at Datadog ScaleKubernetes at Datadog Scale
Kubernetes at Datadog Scale
 
HIPAA Compliant Deployment of Apache Spark on AWS for Healthcare Nitin Panjwa...
HIPAA Compliant Deployment of Apache Spark on AWS for Healthcare Nitin Panjwa...HIPAA Compliant Deployment of Apache Spark on AWS for Healthcare Nitin Panjwa...
HIPAA Compliant Deployment of Apache Spark on AWS for Healthcare Nitin Panjwa...
 
So we're running Apache ZooKeeper. Now What? By Camille Fournier
So we're running Apache ZooKeeper. Now What? By Camille Fournier So we're running Apache ZooKeeper. Now What? By Camille Fournier
So we're running Apache ZooKeeper. Now What? By Camille Fournier
 

Similar to Testing at scale with Redis queues

제3회난공불락 오픈소스 인프라세미나 - MySQL Performance
제3회난공불락 오픈소스 인프라세미나 - MySQL Performance제3회난공불락 오픈소스 인프라세미나 - MySQL Performance
제3회난공불락 오픈소스 인프라세미나 - MySQL PerformanceTommy Lee
 
AWS Webcast - AWS OpsWorks Continuous Integration Demo
AWS Webcast - AWS OpsWorks Continuous Integration Demo  AWS Webcast - AWS OpsWorks Continuous Integration Demo
AWS Webcast - AWS OpsWorks Continuous Integration Demo Amazon Web Services
 
Zero ETL analytics with LLAP in Azure HDInsight
Zero ETL analytics with LLAP in Azure HDInsightZero ETL analytics with LLAP in Azure HDInsight
Zero ETL analytics with LLAP in Azure HDInsightAshish Thapliyal
 
Cost Effectively Run Multiple Oracle Database Copies at Scale
Cost Effectively Run Multiple Oracle Database Copies at Scale Cost Effectively Run Multiple Oracle Database Copies at Scale
Cost Effectively Run Multiple Oracle Database Copies at Scale NetApp
 
Postgres Vienna DB Meetup 2014
Postgres Vienna DB Meetup 2014Postgres Vienna DB Meetup 2014
Postgres Vienna DB Meetup 2014Michael Renner
 
MySQL Tech Tour 2015 - Manage & Tune
MySQL Tech Tour 2015 - Manage & TuneMySQL Tech Tour 2015 - Manage & Tune
MySQL Tech Tour 2015 - Manage & TuneMark Swarbrick
 
The Design, Implementation and Open Source Way of Apache Pegasus
The Design, Implementation and Open Source Way of Apache PegasusThe Design, Implementation and Open Source Way of Apache Pegasus
The Design, Implementation and Open Source Way of Apache Pegasusacelyc1112009
 
Tales from the four-comma club: Managing Kafka as a service at Salesforce | L...
Tales from the four-comma club: Managing Kafka as a service at Salesforce | L...Tales from the four-comma club: Managing Kafka as a service at Salesforce | L...
Tales from the four-comma club: Managing Kafka as a service at Salesforce | L...HostedbyConfluent
 
Performance Scenario: Diagnosing and resolving sudden slow down on two node RAC
Performance Scenario: Diagnosing and resolving sudden slow down on two node RACPerformance Scenario: Diagnosing and resolving sudden slow down on two node RAC
Performance Scenario: Diagnosing and resolving sudden slow down on two node RACKristofferson A
 
ONOS System Test - ONS2016
ONOS System Test - ONS2016ONOS System Test - ONS2016
ONOS System Test - ONS2016Suibin Zhang
 
Ceph Deployment at Target: Customer Spotlight
Ceph Deployment at Target: Customer SpotlightCeph Deployment at Target: Customer Spotlight
Ceph Deployment at Target: Customer SpotlightRed_Hat_Storage
 
Ceph Deployment at Target: Customer Spotlight
Ceph Deployment at Target: Customer SpotlightCeph Deployment at Target: Customer Spotlight
Ceph Deployment at Target: Customer SpotlightColleen Corrice
 
MySQL Utilities -- PyTexas 2015
MySQL Utilities -- PyTexas 2015MySQL Utilities -- PyTexas 2015
MySQL Utilities -- PyTexas 2015Dave Stokes
 
Product Update: EDB Postgres Platform 2017
Product Update: EDB Postgres Platform 2017Product Update: EDB Postgres Platform 2017
Product Update: EDB Postgres Platform 2017EDB
 
(DAT407) Amazon ElastiCache: Deep Dive
(DAT407) Amazon ElastiCache: Deep Dive(DAT407) Amazon ElastiCache: Deep Dive
(DAT407) Amazon ElastiCache: Deep DiveAmazon Web Services
 
Performance Test Driven Development with Oracle Coherence
Performance Test Driven Development with Oracle CoherencePerformance Test Driven Development with Oracle Coherence
Performance Test Driven Development with Oracle Coherencearagozin
 
Taking Splunk to the Next Level - Architecture Breakout Session
Taking Splunk to the Next Level - Architecture Breakout SessionTaking Splunk to the Next Level - Architecture Breakout Session
Taking Splunk to the Next Level - Architecture Breakout SessionSplunk
 
10 Ways to Scale Your Website Silicon Valley Code Camp 2019
10 Ways to Scale Your Website Silicon Valley Code Camp 201910 Ways to Scale Your Website Silicon Valley Code Camp 2019
10 Ways to Scale Your Website Silicon Valley Code Camp 2019Dave Nielsen
 
Fortify aws aurora_proxy_2019_pleu
Fortify aws aurora_proxy_2019_pleuFortify aws aurora_proxy_2019_pleu
Fortify aws aurora_proxy_2019_pleuMarco Tusa
 

Similar to Testing at scale with Redis queues (20)

Introduction to Redis
Introduction to RedisIntroduction to Redis
Introduction to Redis
 
제3회난공불락 오픈소스 인프라세미나 - MySQL Performance
제3회난공불락 오픈소스 인프라세미나 - MySQL Performance제3회난공불락 오픈소스 인프라세미나 - MySQL Performance
제3회난공불락 오픈소스 인프라세미나 - MySQL Performance
 
AWS Webcast - AWS OpsWorks Continuous Integration Demo
AWS Webcast - AWS OpsWorks Continuous Integration Demo  AWS Webcast - AWS OpsWorks Continuous Integration Demo
AWS Webcast - AWS OpsWorks Continuous Integration Demo
 
Zero ETL analytics with LLAP in Azure HDInsight
Zero ETL analytics with LLAP in Azure HDInsightZero ETL analytics with LLAP in Azure HDInsight
Zero ETL analytics with LLAP in Azure HDInsight
 
Cost Effectively Run Multiple Oracle Database Copies at Scale
Cost Effectively Run Multiple Oracle Database Copies at Scale Cost Effectively Run Multiple Oracle Database Copies at Scale
Cost Effectively Run Multiple Oracle Database Copies at Scale
 
Postgres Vienna DB Meetup 2014
Postgres Vienna DB Meetup 2014Postgres Vienna DB Meetup 2014
Postgres Vienna DB Meetup 2014
 
MySQL Tech Tour 2015 - Manage & Tune
MySQL Tech Tour 2015 - Manage & TuneMySQL Tech Tour 2015 - Manage & Tune
MySQL Tech Tour 2015 - Manage & Tune
 
The Design, Implementation and Open Source Way of Apache Pegasus
The Design, Implementation and Open Source Way of Apache PegasusThe Design, Implementation and Open Source Way of Apache Pegasus
The Design, Implementation and Open Source Way of Apache Pegasus
 
Tales from the four-comma club: Managing Kafka as a service at Salesforce | L...
Tales from the four-comma club: Managing Kafka as a service at Salesforce | L...Tales from the four-comma club: Managing Kafka as a service at Salesforce | L...
Tales from the four-comma club: Managing Kafka as a service at Salesforce | L...
 
Performance Scenario: Diagnosing and resolving sudden slow down on two node RAC
Performance Scenario: Diagnosing and resolving sudden slow down on two node RACPerformance Scenario: Diagnosing and resolving sudden slow down on two node RAC
Performance Scenario: Diagnosing and resolving sudden slow down on two node RAC
 
ONOS System Test - ONS2016
ONOS System Test - ONS2016ONOS System Test - ONS2016
ONOS System Test - ONS2016
 
Ceph Deployment at Target: Customer Spotlight
Ceph Deployment at Target: Customer SpotlightCeph Deployment at Target: Customer Spotlight
Ceph Deployment at Target: Customer Spotlight
 
Ceph Deployment at Target: Customer Spotlight
Ceph Deployment at Target: Customer SpotlightCeph Deployment at Target: Customer Spotlight
Ceph Deployment at Target: Customer Spotlight
 
MySQL Utilities -- PyTexas 2015
MySQL Utilities -- PyTexas 2015MySQL Utilities -- PyTexas 2015
MySQL Utilities -- PyTexas 2015
 
Product Update: EDB Postgres Platform 2017
Product Update: EDB Postgres Platform 2017Product Update: EDB Postgres Platform 2017
Product Update: EDB Postgres Platform 2017
 
(DAT407) Amazon ElastiCache: Deep Dive
(DAT407) Amazon ElastiCache: Deep Dive(DAT407) Amazon ElastiCache: Deep Dive
(DAT407) Amazon ElastiCache: Deep Dive
 
Performance Test Driven Development with Oracle Coherence
Performance Test Driven Development with Oracle CoherencePerformance Test Driven Development with Oracle Coherence
Performance Test Driven Development with Oracle Coherence
 
Taking Splunk to the Next Level - Architecture Breakout Session
Taking Splunk to the Next Level - Architecture Breakout SessionTaking Splunk to the Next Level - Architecture Breakout Session
Taking Splunk to the Next Level - Architecture Breakout Session
 
10 Ways to Scale Your Website Silicon Valley Code Camp 2019
10 Ways to Scale Your Website Silicon Valley Code Camp 201910 Ways to Scale Your Website Silicon Valley Code Camp 2019
10 Ways to Scale Your Website Silicon Valley Code Camp 2019
 
Fortify aws aurora_proxy_2019_pleu
Fortify aws aurora_proxy_2019_pleuFortify aws aurora_proxy_2019_pleu
Fortify aws aurora_proxy_2019_pleu
 

More from AAron EvaNS

Testing at scale with redis queues
Testing at scale with redis queuesTesting at scale with redis queues
Testing at scale with redis queuesAAron EvaNS
 
Testing Web Apps and APIs (1)
Testing Web Apps and APIs (1)Testing Web Apps and APIs (1)
Testing Web Apps and APIs (1)AAron EvaNS
 
walkaway-automation
walkaway-automationwalkaway-automation
walkaway-automationAAron EvaNS
 
Refactoring For Testability
Refactoring For TestabilityRefactoring For Testability
Refactoring For TestabilityAAron EvaNS
 

More from AAron EvaNS (6)

Testing at scale with redis queues
Testing at scale with redis queuesTesting at scale with redis queues
Testing at scale with redis queues
 
Testing Web Apps and APIs (1)
Testing Web Apps and APIs (1)Testing Web Apps and APIs (1)
Testing Web Apps and APIs (1)
 
Intro. to bdd
Intro. to bddIntro. to bdd
Intro. to bdd
 
Intro. to BDD
Intro. to BDDIntro. to BDD
Intro. to BDD
 
walkaway-automation
walkaway-automationwalkaway-automation
walkaway-automation
 
Refactoring For Testability
Refactoring For TestabilityRefactoring For Testability
Refactoring For Testability
 

Recently uploaded

TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providermohitmore19
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantAxelRicardoTrocheRiq
 
Cloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackCloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackVICTOR MAESTRE RAMIREZ
 
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
 
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
 
Active Directory Penetration Testing, cionsystems.com.pdf
Active Directory Penetration Testing, cionsystems.com.pdfActive Directory Penetration Testing, cionsystems.com.pdf
Active Directory Penetration Testing, cionsystems.com.pdfCionsystems
 
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
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...OnePlan Solutions
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...kellynguyen01
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionSolGuruz
 
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
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxComplianceQuest1
 
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
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...harshavardhanraghave
 
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.
 
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.
 
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
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVshikhaohhpro
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...gurkirankumar98700
 

Recently uploaded (20)

TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service Consultant
 
Cloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackCloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStack
 
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...
 
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
 
Active Directory Penetration Testing, cionsystems.com.pdf
Active Directory Penetration Testing, cionsystems.com.pdfActive Directory Penetration Testing, cionsystems.com.pdf
Active Directory Penetration Testing, cionsystems.com.pdf
 
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)
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with Precision
 
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
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docx
 
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...
 
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
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
 
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...
 
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 ...
 
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
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTV
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
 

Testing at scale with Redis queues

  • 1. PRESENTED BY Resilient Testing at Scale using Redis Queues to Manage Concurrency Aaron Evans Sauce Labs, Solutions Architect
  • 2. PRESENTED BY 1 Test Automation with Selenium & Sauce Labs Agenda 2 How to implement a queue to manage concurrency 3 Redis data types (STRING, LIST, SET, HASH, ZSET) 4 Notifications with PUBLISH / SUBSCRIBE 5 Using RedisJSON to store complex data (test results) 6 Analyzing historical data with RediSearch 7 Predicting test failures with machine learning
  • 3. PRESENTED BY • My name is Aaron Evans • Accidental software tester • Burned out and went to Fiji to live on the beach • Came back to buy a sailboat but got married instead • Moved to Ecuador and started freelance consulting • Traveled around the USA with my family in an RV • Live in Montana on a farm in the woods & built a yurt About me
  • 4. PRESENTED BY • Sauce Labs is a testing infrastructure company • Founded by creator of Selenium, Jason Huggins • Allows you to run test automation in the cloud on different OS, browsers & mobile devices • Using Selenium & Appium • Essentially a managed remote Selenium grid • Also provides a nice UI, dashboard, reports, manual testing via remote control, and test archives & analytics About Sauce Labs
  • 5. PRESENTED BY • Many tests run in parallel • Need to manage test concurrency • Across multiple teams & users • Triggered by CI server or manually by developers • Flaky / Slow Tests • Analysis & Prediction The Problem
  • 6. PRESENTED BY • Use Redis as a single source of truth • Keep track of how many tests are running • Create a "pool" of sessions • Move from pending, to active, to complete – Like a ledger • Check out a session at the start of each test • Check in when complete • Store test data in Redis for future analysis A Solution
  • 7. PRESENTED BY • KEY/VALUE store – Memcached, Berkeley DB • Relational database – MySQL, PostgreSQL, Oracle • NoSQL database / document store – MongoDB, Cassandra • Shared File System – NFS, SMB • Web Service Alternatives to Redis
  • 8. PRESENTED BY • It’s fast! • Simple API with available client for all major platforms • Nice middle ground between Key/Value and NoSQL • I didn’t want the hassle of setting up hosting or managing infrastructure • Redis Labs has a free service tier that is sufficient • I wanted to learn something new Why Redis
  • 10. PRESENTED BY • Use a STRING to keep a count of concurrent sessions • Numeric values can be incremented/decremented • Subtract from counter when each session starts • Add to counter after each session finishes Keep track of available sessions with a counter
  • 11. PRESENTED BY String operations for simple counter redis.test:6379>setavailable_sessions 100 OK redis.test:6379>GETavailable_sessions "100" redis.test:6379>DECRavailable_sessions (integer) 99 redis.test:6379>INCRavailable_sessions (integer) 100 redis.test:6379>DECRBYavailable_sessions50 (integer) 50 redis.test:6379>INCRBYavailable_sessions25 (integer) 75 redis.test:6379>GETSETavailable_sessions 150 "75"
  • 12. PRESENTED BY • Add session_id to LIST when started • Remove session_id from LIST when complete • Get length of active_sessions to make sure you don’t exceed concurrency • Trim sessions to appropriate size for cleanup Create a LIST of active sessions
  • 13. PRESENTED BY List operations for active sessions redis.test:6379>LPUSHactive_sessions session:123 (integer) 1 redis.test:6379>LPUSHactive_sessions session:124 (integer) 2 redis.test:6379>LPUSHactive_sessions session:125 (integer) 3 redis.test:6379>LREMactive_sessions 1 session:124 (integer) 1 redis.test:6379>LLENactive_sessions (integer) 2 redis.test:6379>LRANGEactive_sessions 0 -1 1) "session:125" 2) "session:123" redis.test:6379>LTRIMactive_sessions 0 99 OK
  • 14. PRESENTED BY • Use a separate list for requested test sessions • First In / First Out (FIFO) queue • LPUSH when a test session is requested • RPOP when an active session becomes available • RPUSHLPOP to atomically push from pending to active Create a queue of pending tests
  • 15. PRESENTED BY List operations for requested sessions queue redis.test:6379>LPUSHrequested_sessionsrequested:126 (integer) 1 redis.test:6379>LPUSHrequested_sessionsrequested:127 (integer) 2 redis.test:6379>RPOPrequested_sessions "requested:126" redis.test:6379>LPUSHactive_sessions session:126 (integer) 4 redis.test:6379>RPOPLPUSHrequested_sessions active_sessions "requested:127" redis.test:6379>LSETactive_sessions 0 session:127 OK redis.test:6379>LRANGEactive_sessions 0 1 1) "session:127" 2) "session:126"
  • 16. PRESENTED BY Transaction for moving from requested to active session redis.test:6379>MULTI OK redis.test:6379>LREMactive_sessions 1 session:126 QUEUED redis.test:6379>BRPOPLPUSHrequested_sessionsactive_sessions 60 QUEUED redis.test:6379>LSETactive_sessions 1 session:128 QUEUED redis.test:6379>EXEC 1) (integer) 1 2) "requested:128" 3) OK redis.test:6379>LINDEXactive_sessions 0 "session:128"
  • 17. PRESENTED BY • Notify client when sessions are available • PUBLISH sends to all clients listening to channel • SUBSCRIBE listens (may be blocking) • Single worker publishes • Avoids need for constant polling for available sessions Notifications with PUBLISH / SUBSCRIBE
  • 18. PRESENTED BY PUBLISH / SUBSCRIBE operations # CLIENTLISTENS redis.test:6379>SUBSCRIBEsessions_available Readingmessages...(pressCtrl-Ctoquit) 1) "subscribe" 2) "sessions_available" 3) (integer) 1 1) "message" 2) "sessions_available" 3) "requested:130" # WORKERPUBLISHES redis.test:6379>PUBLISHsessions_availablerequested:131 (integer) 1
  • 19. PRESENTED BY • Use a SET instead of a LIST • Keys must be unique • Sets aren’t ordered (no push / pop) * SPOP is random • Ok because active_sessions are not necessarily in sequence • Can move elements from one set to another – (e.g. active to completed, passed, failed, errored) • Allows grouping with SUNION, SINTER, SDIFF • Can SORT if needed (and STORE as a list) Avoid duplicate sessions with a SET
  • 20. PRESENTED BY Set operations for managing sessions redis.test:6379>SADDactive_sessions session:123 (integer) 1 redis.test:6379>SADDactive_sessions session:123 (integer) 0 redis.test:6379>SCARDactive_sessions (integer) 1 redis.test:6379>SMOVEactive_sessions completed_sessionssession:123 (integer) 1 redis.test:6379>SADDerrored_sessionssession:124 (integer) 1 redis.test:6379>SUNIONcompleted_sessions errored_sessions 1) "session:124" 2) "session:123"
  • 21. PRESENTED BY Move errored tests to retry queue redis.test:6379>SMEMBERSerrored_sessions 1) "session:126" 2) "session:124" 3) "session:125” redis.test:6379>SORTerrored_sessions ALPHASTOREretry_queue (integer) 3 redis.test:6379>LRANGEretry_queue0 -1 1) "session:124" 2) "session:125" 3) "session:126”
  • 22. PRESENTED BY • Use a ZSET (Sorted Set) • Combines the best features of both LIST and SET – *but it comes at a cost • Unique keys • SCORE allows you to rank tests to specify priority • POP elements by highest or lowest score – ZPOPMAX / ZPOPMIN Implement a priority queue with a sorted test
  • 23. PRESENTED BY ZSET commands for priority queue redis.test:6379>ZADDpriority_queue1 session:1 (integer) 1 redis.test:6379>ZADDpriority_queue2 session:2 (integer) 1 redis.test:6379>ZINCRBYpriority_queue2 session:1 "3" redis.test:6379>ZRANGEpriority_queue0 -1WITHSCORES 1) "session:2" 2) "2" 3) "session:1" 4) "3" redis.test:6379>ZPOPMAX priority_queue 1) "session:1" 2) "3"
  • 24. PRESENTED BY • Store multiple Name/Value pairs • Use session ID as HASH key • Store test metadata – Execution environment capabilities (e.g. OS, browser, version) – Test name, build id, tags – Test status (Passed/Failed, Completed/Errored) Capture test data with a HASH
  • 25. PRESENTED BY Hash operations for storing test data redis.test:6379>HSETsession:123name"login test"platform"Windows10"browser"IE"version "11"tag "regression" (integer) 5 redis.test:6379>HEXISTSsession:123status (integer) 0 redis.test:6379>HSETsession:123statuspassed (integer) 0 redis.test:6379>HGETsession:123 status "passed" redis.test:6379>HGETALLsession:123 1) "name" 2) "login test" … 11) "status" 12) "passed"
  • 26. PRESENTED BY • Hashes only store 1 dimension • Can fake it with multipart keys – foo.bar.baz=quux • Use a common key between records for relationships – testdata:{123} – testresult:{123} • Store as a JSON blob in a STRING • Use Redis JSON • Use Redis Search Storing complex (hierarchical) test data
  • 27. PRESENTED BY • Additional Module • Can be compiled or used with RedisLabs • Allows for storing and querying JSON data Using RedisJSON
  • 28. PRESENTED BY RedisJSON operations redis.test:6379>JSON.SETsession:123. '{"name":"logintest","status":"failed"}' OK redis.test:6379>JSON.GETsession:123status ""failed""
  • 29. PRESENTED BY • Additional Module • Can be compiled or use with RedisLabs • Allows for full text search • Numeric or Tags • Add unstructured data – Test steps – Log files – Error messages & stack traces Using RediSearch
  • 30. PRESENTED BY RediSearch for test results redis.test:6379>FT.CREATEtestresultsSCHEMA nameTEXTplatformTEXTbrowserTEXTversion TEXT exec_timeNUMERICstatusTAG OK redis.test:6379>FT.ADDtestresultstest:1231 FIELDSname"LoginTest"browser"Chrome"exec_time 123.456statusPASSED OK redis.test:6379>FT.SEARCHtestresultslogin 1) (integer) 1 2) "test:123" 3) 1) name 2) "LoginTest" 3) browser 4) "Chrome" 5) exec_time 6) "123.456"
  • 31. PRESENTED BY RediSearch for test results by status tag redis.test:6379>FT.SEARCHtestresults"@status:{PASSED|COMPLETE}" 1) (integer) 1 2) "test:123" 3) 1) name 2) "LoginTest" 3) browser 4) "Chrome" 5) exec_time 6) "123.456" 7) status 8) "PASSED"
  • 32. PRESENTED BY • Finding patterns and anticipating failures • Group By – test failures – platform / browser / device – feature or tags – release / over time series – other data points that you can't predict • Using Machine Learning Looking forwards

Editor's Notes

  1. Here are some pictures of me and my family on some of the adventures we've had.