SlideShare a Scribd company logo
CONFIDENTIAL designator
V0000000
1
How to deal with them
Flaky Tests
Juri Solovjov
Software Quality Engineer
jsolovjo@redhat.com
Flaky
Tests
-
How
to
deal
with
them
juri-solovjov
Introduction
2
Juri Solovjov
▸ Software Quality Engineer
▸ 5+ years at Red Hat in Brno, Czech Republic
▸ Involved in integration middleware projects:
・ Hawtio, Camel Spring Boot, Camel Quarkus, Camel-K
▸ Side projects:
・ Red Hat Summer Camp Brno - an IT camp for high-school students
・ Leading a seminar on Tests in practice at Masaryk University in Brno
What we’ll discuss today
▸ What are Flaky Tests?
▸ Origins of Flaky Tests
▸ Good Practices
▸ Q&A
Agenda
3
CONFIDENTIAL designator
V0000000
4
What are Flaky Tests?
CONFIDENTIAL designator
V0000000
Flaky tests are defined as tests that
return both passes and failures
despite no changes to the code or
the test itself.
What are Flaky Tests?
5
Source:
https://www.jetbrains.com/teamcity/ci-cd-guide/concepts/flaky-tests/
What are Flaky Tests?
6
driver.navigate().to("https://www.google.com/");
driver.findElement(By.name("q")).sendKeys("SFSCon");
driver.findElement(By.cssSelector("[type=submit]")).click();
assertEquals(9, driver.findElement(By.cssSelector("#ires .g")).size());
To pass or to fail - that’s the question
Flaky Tests
Source:
https://selenide.org/blog.html
What are Flaky Tests?
7
▸ What can go wrong?
▸ Which line of the code may break the test?
To pass or to fail - that’s the question
Flaky Tests
Source:
https://selenide.org/blog.html
What are Flaky Tests?
8
driver.navigate().to("https://www.google.com/");
driver.findElement(By.name("q")).sendKeys("SFSCon");
driver.findElement(By.cssSelector("[type=submit]")).click();
assertEquals(9, driver.findElement(By.cssSelector("#ires .g")).size());
To pass or to fail - that’s the question
Flaky Tests
Source:
https://selenide.org/blog.html
What are Flaky Tests?
9
▸ 4 matching elements - 2 of them are hidden
▸ Possible fix is to modify the third line of the code
driver.findElement(By.name("btnK")).click();
To pass or to fail - that’s the question
Flaky Tests
What are Flaky Tests?
10
▸ However, the flakiness is still present
▸ When filling a search bar - the dropdown list hides the first search button and another one shows up
To pass or to fail - that’s the question
Flaky Tests
What are Flaky Tests?
11
One of the solution might be using a framework with smart built-in timeouts and retries
▸ In case of Selenide framework (free and open-source):
@Test
public void userCanLogin() {
open("https://www.google.com");
$(byName("q")).setValue("selenide");
$("[name=btnK]").click();
$$("#ires .g").shouldHave(size(10));
}
To pass or to fail - that’s the question
Flaky Tests
Source:
https://selenide.org/
CONFIDENTIAL designator
V0000000
12
Origins of Flaky Tests
Origins of Flaky Tests
13
There are many reasons why flaky tests may show up in your test pipelines
▸ Test Environment
・ Lack of memory and space, caching issues
・ Docker and Jenkins issues
▸ Connection
・ Requests and responses speed and their order
▸ Test Frameworks
・ Versions mismatch, dropped support, bugs
Flaky Tests
CONFIDENTIAL designator
V0000000
Test Frameworks
Origins of Flaky Tests
14
Origins of Flaky Tests
15
▸ TypeError: _.filter is not a function
▸ Nothing is clickable
▸ Affects only automation
▸ Unstuck only after refresh
▸ Manually works fine
Test Frameworks
Origins of Flaky Tests
16
The root cause:
▸ Updating to Selenium 4.12.0 caused the issue #12659 where Selenium overwrites _ sign
Test Frameworks
Origins of Flaky Tests
17
▸ It’s not always a good idea to blindly update all versions of frameworks in your project
・ Lost support (e.g. dropped java 8 support)
・ A new bug is introduced
▸ Version mismatch of frameworks is also a common issue
・ A new version may bring new requirements and changes in a code
Test Frameworks
CONFIDENTIAL designator
V0000000
Test Environment
Origins of Flaky Tests
18
Origins of Flaky Tests
19
Test Environment
Origins of Flaky Tests
20
Rebuild a job helped to get it passed
▸ However, the job was still failing and passing in a random order
What could go wrong?
▸ Lost Internet connection when pulling images or it met pulling limits
▸ Lost connection to a testing machine
▸ Lack of memory and space
▸ Error while building and deploying quickstarts for the app under test
▸ etc.
Test Environment
Origins of Flaky Tests
21
What actually happened
▸ An application deployed on OpenShift become unstable after a while
▸ Continuously stopping and restarting accompanied by the error Liveness probe failed
▸ The application’s pod on OpenShift didn’t show detailed error messages
Test Environment
Origins of Flaky Tests
22
It turned out that
▸ It was caused by the app’s pod exceeding its memory allocation on OpenShift
▸ The resources weren’t defined by default
What helped us is to edit app’s deployment configuration to increase the memory allocation
▸ spec:
resources:
limits:
cpu: "1"
memory: 100Mi
requests:
cpu: 200m
memory: 32Mi
Test Environment
Origins of Flaky Tests
23
▸ Clean up clusters, terminate unnecessary machines, remove namespaces/projects;
▸ Keep track of internal shared repositories, their space and do clean up jobs;
▸ Do not create machines with large resources for low-cost work;
Test Environment: Resources
Origins of Flaky Tests
24
▸ If you have pipelines in parallel using the same resources and sharing the same cluster
・ Avoid job deadlocks
・ Add checks, conditions, timeouts
Test Environment: Automation
Origins of Flaky Tests
25
▸ Connection is stable
▸ VPN is up
▸ Nothing is overloading network
▸ No outages are happening
Test Environment: Infrastructure
CONFIDENTIAL designator
V0000000
Application under test
Origins of Flaky Tests
26
Origins of Flaky Tests
27
Also, flaky tests occur due to changes such as new features or new bugs introduced by developers
▸ Performance
▸ Bugs in the application
▸ Runtimes
Application under test
Origins of Flaky Tests
28
▸ The loading order of the modules was not explicitly defined
▸ Sometimes, rendering of the page was faster than modules get loaded
▸ It caused a missing Logout button and therefore failures of the tests
Application under test
Origins of Flaky Tests
29
▸ A broken layout for drop-down menu
▸ Tests were mostly passing
▸ Tests are running in a background with no UI
▸ It required us to do a manual testing to find it
Application under test
CONFIDENTIAL designator
V0000000
30
Good Practices
Good Practices
31
▸ Consider test frameworks with built-in timeouts and smart retries
▸ Do not use common locators but unique ones
▸ Collaborate with developers
▸ Beware of version updates
Good Practices
Good Practices
32
▸ Keep an eye on infrastructure
・ Space, memory, hanging jobs and machines
▸ It’s always good to know your application under test
▸ Be familiar with the application infrastructure
・ To develop tests effectively with low cost
・ To decrease number of potential flaky tests and issues
・ Easily debug
Good Practices
CONFIDENTIAL designator
V0000000
Flakiness consumes resources and
time from the Product Team and
this costs money.
Conclusion
33
CONFIDENTIAL designator
V0000000
34
Q&A
Find me online
CONFIDENTIAL designator
V0000000
linkedin.com/company/red-hat
youtube.com/user/RedHatVideos
facebook.com/redhatinc
twitter.com/RedHat
35
Red Hat is the world’s leading provider of enterprise
open source software solutions. Award-winning support,
training, and consulting services make Red Hat a trusted
adviser to the Fortune 500.
Thank you
Flaky
Tests
-
How
to
deal
with
them

More Related Content

Similar to SFSCON23 - Juri Solovjov - Flaky tests – how to deal with them

Quality Assurance with Manual Testing
Quality Assurance with Manual TestingQuality Assurance with Manual Testing
Quality Assurance with Manual Testing
Edureka!
 
Continuous Delivery Applied (AgileDC)
Continuous Delivery Applied (AgileDC)Continuous Delivery Applied (AgileDC)
Continuous Delivery Applied (AgileDC)
Mike McGarr
 
Deploying ML models to production (frequently and safely) - PYCON 2018
Deploying ML models to production (frequently and safely) - PYCON 2018Deploying ML models to production (frequently and safely) - PYCON 2018
Deploying ML models to production (frequently and safely) - PYCON 2018
David Tan
 
Continuous delivery applied
Continuous delivery appliedContinuous delivery applied
Continuous delivery applied
Mike McGarr
 
Test Design + Environment Management: Scaling UI Automation for Agile
Test Design + Environment Management: Scaling UI Automation for AgileTest Design + Environment Management: Scaling UI Automation for Agile
Test Design + Environment Management: Scaling UI Automation for Agile
SmartBear
 
How to build confidence in your release cycle
How to build confidence in your release cycleHow to build confidence in your release cycle
How to build confidence in your release cycle
DiUS
 
Integrating Black Duck into your Agile DevOps Environment
Integrating Black Duck into your Agile DevOps EnvironmentIntegrating Black Duck into your Agile DevOps Environment
Integrating Black Duck into your Agile DevOps Environment
Black Duck by Synopsys
 
Agile Bodensee - Testautomation & Continuous Delivery Workshop
Agile Bodensee - Testautomation & Continuous Delivery WorkshopAgile Bodensee - Testautomation & Continuous Delivery Workshop
Agile Bodensee - Testautomation & Continuous Delivery Workshop
Michael Palotas
 
Software Testing - Online Guide
Software Testing - Online GuideSoftware Testing - Online Guide
Software Testing - Online Guide
bigspire
 
Continuous delivery applied (RJUG)
Continuous delivery applied (RJUG)Continuous delivery applied (RJUG)
Continuous delivery applied (RJUG)
Mike McGarr
 
Bridging the gap - Security and Software Testing
Bridging the gap - Security and Software TestingBridging the gap - Security and Software Testing
Bridging the gap - Security and Software Testing
Roberto Suggi Liverani
 
Test Process in Agile vs Waterfall
Test Process in Agile vs WaterfallTest Process in Agile vs Waterfall
Test Process in Agile vs Waterfall
Return on Intelligence
 
Testing Applications—For the Cloud and in the Cloud
Testing Applications—For the Cloud and in the CloudTesting Applications—For the Cloud and in the Cloud
Testing Applications—For the Cloud and in the Cloud
TechWell
 
Test driven development
Test driven developmentTest driven development
Test driven development
Sunil Prasad
 
Just Java2007 - Daniel Wildt - Tools For Java Test Automation
Just Java2007 - Daniel Wildt - Tools For Java Test AutomationJust Java2007 - Daniel Wildt - Tools For Java Test Automation
Just Java2007 - Daniel Wildt - Tools For Java Test Automation
Daniel Wildt
 
TLC2018 Thomas Haver: The Automation Firehose - Be Strategic and Tactical
TLC2018 Thomas Haver: The Automation Firehose - Be Strategic and TacticalTLC2018 Thomas Haver: The Automation Firehose - Be Strategic and Tactical
TLC2018 Thomas Haver: The Automation Firehose - Be Strategic and Tactical
Anna Royzman
 
What to Do—Develop Your Own Automation or Use Crowdsourced Testing?
What to Do—Develop Your Own Automation or Use Crowdsourced Testing?What to Do—Develop Your Own Automation or Use Crowdsourced Testing?
What to Do—Develop Your Own Automation or Use Crowdsourced Testing?
TechWell
 
Continuous Testing
Continuous TestingContinuous Testing
Continuous Testing
jaredrrichardson
 
Software Testing Tutorials - MindScripts Technologies, Pune
Software Testing Tutorials - MindScripts Technologies, PuneSoftware Testing Tutorials - MindScripts Technologies, Pune
Software Testing Tutorials - MindScripts Technologies, Pune
sanjayjadhav8789
 
Никита Галкин "Testing in Frontend World"
Никита Галкин "Testing in Frontend World"Никита Галкин "Testing in Frontend World"
Никита Галкин "Testing in Frontend World"
Fwdays
 

Similar to SFSCON23 - Juri Solovjov - Flaky tests – how to deal with them (20)

Quality Assurance with Manual Testing
Quality Assurance with Manual TestingQuality Assurance with Manual Testing
Quality Assurance with Manual Testing
 
Continuous Delivery Applied (AgileDC)
Continuous Delivery Applied (AgileDC)Continuous Delivery Applied (AgileDC)
Continuous Delivery Applied (AgileDC)
 
Deploying ML models to production (frequently and safely) - PYCON 2018
Deploying ML models to production (frequently and safely) - PYCON 2018Deploying ML models to production (frequently and safely) - PYCON 2018
Deploying ML models to production (frequently and safely) - PYCON 2018
 
Continuous delivery applied
Continuous delivery appliedContinuous delivery applied
Continuous delivery applied
 
Test Design + Environment Management: Scaling UI Automation for Agile
Test Design + Environment Management: Scaling UI Automation for AgileTest Design + Environment Management: Scaling UI Automation for Agile
Test Design + Environment Management: Scaling UI Automation for Agile
 
How to build confidence in your release cycle
How to build confidence in your release cycleHow to build confidence in your release cycle
How to build confidence in your release cycle
 
Integrating Black Duck into your Agile DevOps Environment
Integrating Black Duck into your Agile DevOps EnvironmentIntegrating Black Duck into your Agile DevOps Environment
Integrating Black Duck into your Agile DevOps Environment
 
Agile Bodensee - Testautomation & Continuous Delivery Workshop
Agile Bodensee - Testautomation & Continuous Delivery WorkshopAgile Bodensee - Testautomation & Continuous Delivery Workshop
Agile Bodensee - Testautomation & Continuous Delivery Workshop
 
Software Testing - Online Guide
Software Testing - Online GuideSoftware Testing - Online Guide
Software Testing - Online Guide
 
Continuous delivery applied (RJUG)
Continuous delivery applied (RJUG)Continuous delivery applied (RJUG)
Continuous delivery applied (RJUG)
 
Bridging the gap - Security and Software Testing
Bridging the gap - Security and Software TestingBridging the gap - Security and Software Testing
Bridging the gap - Security and Software Testing
 
Test Process in Agile vs Waterfall
Test Process in Agile vs WaterfallTest Process in Agile vs Waterfall
Test Process in Agile vs Waterfall
 
Testing Applications—For the Cloud and in the Cloud
Testing Applications—For the Cloud and in the CloudTesting Applications—For the Cloud and in the Cloud
Testing Applications—For the Cloud and in the Cloud
 
Test driven development
Test driven developmentTest driven development
Test driven development
 
Just Java2007 - Daniel Wildt - Tools For Java Test Automation
Just Java2007 - Daniel Wildt - Tools For Java Test AutomationJust Java2007 - Daniel Wildt - Tools For Java Test Automation
Just Java2007 - Daniel Wildt - Tools For Java Test Automation
 
TLC2018 Thomas Haver: The Automation Firehose - Be Strategic and Tactical
TLC2018 Thomas Haver: The Automation Firehose - Be Strategic and TacticalTLC2018 Thomas Haver: The Automation Firehose - Be Strategic and Tactical
TLC2018 Thomas Haver: The Automation Firehose - Be Strategic and Tactical
 
What to Do—Develop Your Own Automation or Use Crowdsourced Testing?
What to Do—Develop Your Own Automation or Use Crowdsourced Testing?What to Do—Develop Your Own Automation or Use Crowdsourced Testing?
What to Do—Develop Your Own Automation or Use Crowdsourced Testing?
 
Continuous Testing
Continuous TestingContinuous Testing
Continuous Testing
 
Software Testing Tutorials - MindScripts Technologies, Pune
Software Testing Tutorials - MindScripts Technologies, PuneSoftware Testing Tutorials - MindScripts Technologies, Pune
Software Testing Tutorials - MindScripts Technologies, Pune
 
Никита Галкин "Testing in Frontend World"
Никита Галкин "Testing in Frontend World"Никита Галкин "Testing in Frontend World"
Никита Галкин "Testing in Frontend World"
 

More from South Tyrol Free Software Conference

SFSCON23 - Rufai Omowunmi Balogun - SMODEX – a Python package for understandi...
SFSCON23 - Rufai Omowunmi Balogun - SMODEX – a Python package for understandi...SFSCON23 - Rufai Omowunmi Balogun - SMODEX – a Python package for understandi...
SFSCON23 - Rufai Omowunmi Balogun - SMODEX – a Python package for understandi...
South Tyrol Free Software Conference
 
SFSCON23 - Roberto Innocenti - From the design to reality is here the Communi...
SFSCON23 - Roberto Innocenti - From the design to reality is here the Communi...SFSCON23 - Roberto Innocenti - From the design to reality is here the Communi...
SFSCON23 - Roberto Innocenti - From the design to reality is here the Communi...
South Tyrol Free Software Conference
 
SFSCON23 - Martin Rabanser - Real-time aeroplane tracking and the Open Data Hub
SFSCON23 - Martin Rabanser - Real-time aeroplane tracking and the Open Data HubSFSCON23 - Martin Rabanser - Real-time aeroplane tracking and the Open Data Hub
SFSCON23 - Martin Rabanser - Real-time aeroplane tracking and the Open Data Hub
South Tyrol Free Software Conference
 
SFSCON23 - Marianna d'Atri Enrico Zanardo - How can Blockchain technologies i...
SFSCON23 - Marianna d'Atri Enrico Zanardo - How can Blockchain technologies i...SFSCON23 - Marianna d'Atri Enrico Zanardo - How can Blockchain technologies i...
SFSCON23 - Marianna d'Atri Enrico Zanardo - How can Blockchain technologies i...
South Tyrol Free Software Conference
 
SFSCON23 - Lucas Lasota - The Future of Connectivity, Open Internet and Human...
SFSCON23 - Lucas Lasota - The Future of Connectivity, Open Internet and Human...SFSCON23 - Lucas Lasota - The Future of Connectivity, Open Internet and Human...
SFSCON23 - Lucas Lasota - The Future of Connectivity, Open Internet and Human...
South Tyrol Free Software Conference
 
SFSCON23 - Giovanni Giannotta - Intelligent Decision Support System for trace...
SFSCON23 - Giovanni Giannotta - Intelligent Decision Support System for trace...SFSCON23 - Giovanni Giannotta - Intelligent Decision Support System for trace...
SFSCON23 - Giovanni Giannotta - Intelligent Decision Support System for trace...
South Tyrol Free Software Conference
 
SFSCON23 - Elena Maines - Embracing CI/CD workflows for building ETL pipelines
SFSCON23 - Elena Maines - Embracing CI/CD workflows for building ETL pipelinesSFSCON23 - Elena Maines - Embracing CI/CD workflows for building ETL pipelines
SFSCON23 - Elena Maines - Embracing CI/CD workflows for building ETL pipelines
South Tyrol Free Software Conference
 
SFSCON23 - Christian Busse - Free Software and Open Science
SFSCON23 - Christian Busse - Free Software and Open ScienceSFSCON23 - Christian Busse - Free Software and Open Science
SFSCON23 - Christian Busse - Free Software and Open Science
South Tyrol Free Software Conference
 
SFSCON23 - Charles H. Schulz - Why open digital infrastructure matters
SFSCON23 - Charles H. Schulz - Why open digital infrastructure mattersSFSCON23 - Charles H. Schulz - Why open digital infrastructure matters
SFSCON23 - Charles H. Schulz - Why open digital infrastructure matters
South Tyrol Free Software Conference
 
SFSCON23 - Andrea Vianello - Achieving FAIRness with EDP-portal
SFSCON23 - Andrea Vianello - Achieving FAIRness with EDP-portalSFSCON23 - Andrea Vianello - Achieving FAIRness with EDP-portal
SFSCON23 - Andrea Vianello - Achieving FAIRness with EDP-portal
South Tyrol Free Software Conference
 
SFSCON23 - Thomas Aichner - How IoT and AI are revolutionizing Mass Customiza...
SFSCON23 - Thomas Aichner - How IoT and AI are revolutionizing Mass Customiza...SFSCON23 - Thomas Aichner - How IoT and AI are revolutionizing Mass Customiza...
SFSCON23 - Thomas Aichner - How IoT and AI are revolutionizing Mass Customiza...
South Tyrol Free Software Conference
 
SFSCON23 - Stefan Mutschlechner - Smart Werke Meran
SFSCON23 - Stefan Mutschlechner - Smart Werke MeranSFSCON23 - Stefan Mutschlechner - Smart Werke Meran
SFSCON23 - Stefan Mutschlechner - Smart Werke Meran
South Tyrol Free Software Conference
 
SFSCON23 - Mirko Boehm - European regulators cast their eyes on maturing OSS ...
SFSCON23 - Mirko Boehm - European regulators cast their eyes on maturing OSS ...SFSCON23 - Mirko Boehm - European regulators cast their eyes on maturing OSS ...
SFSCON23 - Mirko Boehm - European regulators cast their eyes on maturing OSS ...
South Tyrol Free Software Conference
 
SFSCON23 - Marco Pavanelli - Monitoring the fleet of Sasa with free software
SFSCON23 - Marco Pavanelli - Monitoring the fleet of Sasa with free softwareSFSCON23 - Marco Pavanelli - Monitoring the fleet of Sasa with free software
SFSCON23 - Marco Pavanelli - Monitoring the fleet of Sasa with free software
South Tyrol Free Software Conference
 
SFSCON23 - Marco Cortella - KNOWAGE and AICS for 2030 agenda SDG goals monito...
SFSCON23 - Marco Cortella - KNOWAGE and AICS for 2030 agenda SDG goals monito...SFSCON23 - Marco Cortella - KNOWAGE and AICS for 2030 agenda SDG goals monito...
SFSCON23 - Marco Cortella - KNOWAGE and AICS for 2030 agenda SDG goals monito...
South Tyrol Free Software Conference
 
SFSCON23 - Lina Ceballos - Interoperable Europe Act - A real game changer
SFSCON23 - Lina Ceballos - Interoperable Europe Act - A real game changerSFSCON23 - Lina Ceballos - Interoperable Europe Act - A real game changer
SFSCON23 - Lina Ceballos - Interoperable Europe Act - A real game changer
South Tyrol Free Software Conference
 
SFSCON23 - Johannes Näder Linus Sehn - Let’s monitor implementation of Free S...
SFSCON23 - Johannes Näder Linus Sehn - Let’s monitor implementation of Free S...SFSCON23 - Johannes Näder Linus Sehn - Let’s monitor implementation of Free S...
SFSCON23 - Johannes Näder Linus Sehn - Let’s monitor implementation of Free S...
South Tyrol Free Software Conference
 
SFSCON23 - Gabriel Ku Wei Bin - Why Do We Need A Next Generation Internet
SFSCON23 - Gabriel Ku Wei Bin - Why Do We Need A Next Generation InternetSFSCON23 - Gabriel Ku Wei Bin - Why Do We Need A Next Generation Internet
SFSCON23 - Gabriel Ku Wei Bin - Why Do We Need A Next Generation Internet
South Tyrol Free Software Conference
 
SFSCON23 - Edoardo Scepi - The Brand-New Version of IGis Maps
SFSCON23 - Edoardo Scepi - The Brand-New Version of IGis MapsSFSCON23 - Edoardo Scepi - The Brand-New Version of IGis Maps
SFSCON23 - Edoardo Scepi - The Brand-New Version of IGis Maps
South Tyrol Free Software Conference
 
SFSCON23 - Davide Vernassa - Empowering Insights Unveiling the latest innova...
SFSCON23 - Davide Vernassa - Empowering Insights  Unveiling the latest innova...SFSCON23 - Davide Vernassa - Empowering Insights  Unveiling the latest innova...
SFSCON23 - Davide Vernassa - Empowering Insights Unveiling the latest innova...
South Tyrol Free Software Conference
 

More from South Tyrol Free Software Conference (20)

SFSCON23 - Rufai Omowunmi Balogun - SMODEX – a Python package for understandi...
SFSCON23 - Rufai Omowunmi Balogun - SMODEX – a Python package for understandi...SFSCON23 - Rufai Omowunmi Balogun - SMODEX – a Python package for understandi...
SFSCON23 - Rufai Omowunmi Balogun - SMODEX – a Python package for understandi...
 
SFSCON23 - Roberto Innocenti - From the design to reality is here the Communi...
SFSCON23 - Roberto Innocenti - From the design to reality is here the Communi...SFSCON23 - Roberto Innocenti - From the design to reality is here the Communi...
SFSCON23 - Roberto Innocenti - From the design to reality is here the Communi...
 
SFSCON23 - Martin Rabanser - Real-time aeroplane tracking and the Open Data Hub
SFSCON23 - Martin Rabanser - Real-time aeroplane tracking and the Open Data HubSFSCON23 - Martin Rabanser - Real-time aeroplane tracking and the Open Data Hub
SFSCON23 - Martin Rabanser - Real-time aeroplane tracking and the Open Data Hub
 
SFSCON23 - Marianna d'Atri Enrico Zanardo - How can Blockchain technologies i...
SFSCON23 - Marianna d'Atri Enrico Zanardo - How can Blockchain technologies i...SFSCON23 - Marianna d'Atri Enrico Zanardo - How can Blockchain technologies i...
SFSCON23 - Marianna d'Atri Enrico Zanardo - How can Blockchain technologies i...
 
SFSCON23 - Lucas Lasota - The Future of Connectivity, Open Internet and Human...
SFSCON23 - Lucas Lasota - The Future of Connectivity, Open Internet and Human...SFSCON23 - Lucas Lasota - The Future of Connectivity, Open Internet and Human...
SFSCON23 - Lucas Lasota - The Future of Connectivity, Open Internet and Human...
 
SFSCON23 - Giovanni Giannotta - Intelligent Decision Support System for trace...
SFSCON23 - Giovanni Giannotta - Intelligent Decision Support System for trace...SFSCON23 - Giovanni Giannotta - Intelligent Decision Support System for trace...
SFSCON23 - Giovanni Giannotta - Intelligent Decision Support System for trace...
 
SFSCON23 - Elena Maines - Embracing CI/CD workflows for building ETL pipelines
SFSCON23 - Elena Maines - Embracing CI/CD workflows for building ETL pipelinesSFSCON23 - Elena Maines - Embracing CI/CD workflows for building ETL pipelines
SFSCON23 - Elena Maines - Embracing CI/CD workflows for building ETL pipelines
 
SFSCON23 - Christian Busse - Free Software and Open Science
SFSCON23 - Christian Busse - Free Software and Open ScienceSFSCON23 - Christian Busse - Free Software and Open Science
SFSCON23 - Christian Busse - Free Software and Open Science
 
SFSCON23 - Charles H. Schulz - Why open digital infrastructure matters
SFSCON23 - Charles H. Schulz - Why open digital infrastructure mattersSFSCON23 - Charles H. Schulz - Why open digital infrastructure matters
SFSCON23 - Charles H. Schulz - Why open digital infrastructure matters
 
SFSCON23 - Andrea Vianello - Achieving FAIRness with EDP-portal
SFSCON23 - Andrea Vianello - Achieving FAIRness with EDP-portalSFSCON23 - Andrea Vianello - Achieving FAIRness with EDP-portal
SFSCON23 - Andrea Vianello - Achieving FAIRness with EDP-portal
 
SFSCON23 - Thomas Aichner - How IoT and AI are revolutionizing Mass Customiza...
SFSCON23 - Thomas Aichner - How IoT and AI are revolutionizing Mass Customiza...SFSCON23 - Thomas Aichner - How IoT and AI are revolutionizing Mass Customiza...
SFSCON23 - Thomas Aichner - How IoT and AI are revolutionizing Mass Customiza...
 
SFSCON23 - Stefan Mutschlechner - Smart Werke Meran
SFSCON23 - Stefan Mutschlechner - Smart Werke MeranSFSCON23 - Stefan Mutschlechner - Smart Werke Meran
SFSCON23 - Stefan Mutschlechner - Smart Werke Meran
 
SFSCON23 - Mirko Boehm - European regulators cast their eyes on maturing OSS ...
SFSCON23 - Mirko Boehm - European regulators cast their eyes on maturing OSS ...SFSCON23 - Mirko Boehm - European regulators cast their eyes on maturing OSS ...
SFSCON23 - Mirko Boehm - European regulators cast their eyes on maturing OSS ...
 
SFSCON23 - Marco Pavanelli - Monitoring the fleet of Sasa with free software
SFSCON23 - Marco Pavanelli - Monitoring the fleet of Sasa with free softwareSFSCON23 - Marco Pavanelli - Monitoring the fleet of Sasa with free software
SFSCON23 - Marco Pavanelli - Monitoring the fleet of Sasa with free software
 
SFSCON23 - Marco Cortella - KNOWAGE and AICS for 2030 agenda SDG goals monito...
SFSCON23 - Marco Cortella - KNOWAGE and AICS for 2030 agenda SDG goals monito...SFSCON23 - Marco Cortella - KNOWAGE and AICS for 2030 agenda SDG goals monito...
SFSCON23 - Marco Cortella - KNOWAGE and AICS for 2030 agenda SDG goals monito...
 
SFSCON23 - Lina Ceballos - Interoperable Europe Act - A real game changer
SFSCON23 - Lina Ceballos - Interoperable Europe Act - A real game changerSFSCON23 - Lina Ceballos - Interoperable Europe Act - A real game changer
SFSCON23 - Lina Ceballos - Interoperable Europe Act - A real game changer
 
SFSCON23 - Johannes Näder Linus Sehn - Let’s monitor implementation of Free S...
SFSCON23 - Johannes Näder Linus Sehn - Let’s monitor implementation of Free S...SFSCON23 - Johannes Näder Linus Sehn - Let’s monitor implementation of Free S...
SFSCON23 - Johannes Näder Linus Sehn - Let’s monitor implementation of Free S...
 
SFSCON23 - Gabriel Ku Wei Bin - Why Do We Need A Next Generation Internet
SFSCON23 - Gabriel Ku Wei Bin - Why Do We Need A Next Generation InternetSFSCON23 - Gabriel Ku Wei Bin - Why Do We Need A Next Generation Internet
SFSCON23 - Gabriel Ku Wei Bin - Why Do We Need A Next Generation Internet
 
SFSCON23 - Edoardo Scepi - The Brand-New Version of IGis Maps
SFSCON23 - Edoardo Scepi - The Brand-New Version of IGis MapsSFSCON23 - Edoardo Scepi - The Brand-New Version of IGis Maps
SFSCON23 - Edoardo Scepi - The Brand-New Version of IGis Maps
 
SFSCON23 - Davide Vernassa - Empowering Insights Unveiling the latest innova...
SFSCON23 - Davide Vernassa - Empowering Insights  Unveiling the latest innova...SFSCON23 - Davide Vernassa - Empowering Insights  Unveiling the latest innova...
SFSCON23 - Davide Vernassa - Empowering Insights Unveiling the latest innova...
 

Recently uploaded

Artificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopmentArtificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopment
Octavian Nadolu
 
Fueling AI with Great Data with Airbyte Webinar
Fueling AI with Great Data with Airbyte WebinarFueling AI with Great Data with Airbyte Webinar
Fueling AI with Great Data with Airbyte Webinar
Zilliz
 
5th LF Energy Power Grid Model Meet-up Slides
5th LF Energy Power Grid Model Meet-up Slides5th LF Energy Power Grid Model Meet-up Slides
5th LF Energy Power Grid Model Meet-up Slides
DanBrown980551
 
Webinar: Designing a schema for a Data Warehouse
Webinar: Designing a schema for a Data WarehouseWebinar: Designing a schema for a Data Warehouse
Webinar: Designing a schema for a Data Warehouse
Federico Razzoli
 
Digital Marketing Trends in 2024 | Guide for Staying Ahead
Digital Marketing Trends in 2024 | Guide for Staying AheadDigital Marketing Trends in 2024 | Guide for Staying Ahead
Digital Marketing Trends in 2024 | Guide for Staying Ahead
Wask
 
HCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAUHCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAU
panagenda
 
OpenID AuthZEN Interop Read Out - Authorization
OpenID AuthZEN Interop Read Out - AuthorizationOpenID AuthZEN Interop Read Out - Authorization
OpenID AuthZEN Interop Read Out - Authorization
David Brossard
 
Building Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and MilvusBuilding Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and Milvus
Zilliz
 
How to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptxHow to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptx
danishmna97
 
AI 101: An Introduction to the Basics and Impact of Artificial Intelligence
AI 101: An Introduction to the Basics and Impact of Artificial IntelligenceAI 101: An Introduction to the Basics and Impact of Artificial Intelligence
AI 101: An Introduction to the Basics and Impact of Artificial Intelligence
IndexBug
 
UI5 Controls simplified - UI5con2024 presentation
UI5 Controls simplified - UI5con2024 presentationUI5 Controls simplified - UI5con2024 presentation
UI5 Controls simplified - UI5con2024 presentation
Wouter Lemaire
 
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with SlackLet's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
shyamraj55
 
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
名前 です男
 
Programming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup SlidesProgramming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup Slides
Zilliz
 
National Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practicesNational Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practices
Quotidiano Piemontese
 
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
Edge AI and Vision Alliance
 
20240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 202420240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 2024
Matthew Sinclair
 
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Speck&Tech
 
Recommendation System using RAG Architecture
Recommendation System using RAG ArchitectureRecommendation System using RAG Architecture
Recommendation System using RAG Architecture
fredae14
 
Skybuffer SAM4U tool for SAP license adoption
Skybuffer SAM4U tool for SAP license adoptionSkybuffer SAM4U tool for SAP license adoption
Skybuffer SAM4U tool for SAP license adoption
Tatiana Kojar
 

Recently uploaded (20)

Artificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopmentArtificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopment
 
Fueling AI with Great Data with Airbyte Webinar
Fueling AI with Great Data with Airbyte WebinarFueling AI with Great Data with Airbyte Webinar
Fueling AI with Great Data with Airbyte Webinar
 
5th LF Energy Power Grid Model Meet-up Slides
5th LF Energy Power Grid Model Meet-up Slides5th LF Energy Power Grid Model Meet-up Slides
5th LF Energy Power Grid Model Meet-up Slides
 
Webinar: Designing a schema for a Data Warehouse
Webinar: Designing a schema for a Data WarehouseWebinar: Designing a schema for a Data Warehouse
Webinar: Designing a schema for a Data Warehouse
 
Digital Marketing Trends in 2024 | Guide for Staying Ahead
Digital Marketing Trends in 2024 | Guide for Staying AheadDigital Marketing Trends in 2024 | Guide for Staying Ahead
Digital Marketing Trends in 2024 | Guide for Staying Ahead
 
HCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAUHCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAU
 
OpenID AuthZEN Interop Read Out - Authorization
OpenID AuthZEN Interop Read Out - AuthorizationOpenID AuthZEN Interop Read Out - Authorization
OpenID AuthZEN Interop Read Out - Authorization
 
Building Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and MilvusBuilding Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and Milvus
 
How to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptxHow to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptx
 
AI 101: An Introduction to the Basics and Impact of Artificial Intelligence
AI 101: An Introduction to the Basics and Impact of Artificial IntelligenceAI 101: An Introduction to the Basics and Impact of Artificial Intelligence
AI 101: An Introduction to the Basics and Impact of Artificial Intelligence
 
UI5 Controls simplified - UI5con2024 presentation
UI5 Controls simplified - UI5con2024 presentationUI5 Controls simplified - UI5con2024 presentation
UI5 Controls simplified - UI5con2024 presentation
 
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with SlackLet's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
 
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
 
Programming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup SlidesProgramming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup Slides
 
National Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practicesNational Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practices
 
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
 
20240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 202420240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 2024
 
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
 
Recommendation System using RAG Architecture
Recommendation System using RAG ArchitectureRecommendation System using RAG Architecture
Recommendation System using RAG Architecture
 
Skybuffer SAM4U tool for SAP license adoption
Skybuffer SAM4U tool for SAP license adoptionSkybuffer SAM4U tool for SAP license adoption
Skybuffer SAM4U tool for SAP license adoption
 

SFSCON23 - Juri Solovjov - Flaky tests – how to deal with them

  • 1. CONFIDENTIAL designator V0000000 1 How to deal with them Flaky Tests Juri Solovjov Software Quality Engineer jsolovjo@redhat.com Flaky Tests - How to deal with them juri-solovjov
  • 2. Introduction 2 Juri Solovjov ▸ Software Quality Engineer ▸ 5+ years at Red Hat in Brno, Czech Republic ▸ Involved in integration middleware projects: ・ Hawtio, Camel Spring Boot, Camel Quarkus, Camel-K ▸ Side projects: ・ Red Hat Summer Camp Brno - an IT camp for high-school students ・ Leading a seminar on Tests in practice at Masaryk University in Brno
  • 3. What we’ll discuss today ▸ What are Flaky Tests? ▸ Origins of Flaky Tests ▸ Good Practices ▸ Q&A Agenda 3
  • 5. CONFIDENTIAL designator V0000000 Flaky tests are defined as tests that return both passes and failures despite no changes to the code or the test itself. What are Flaky Tests? 5 Source: https://www.jetbrains.com/teamcity/ci-cd-guide/concepts/flaky-tests/
  • 6. What are Flaky Tests? 6 driver.navigate().to("https://www.google.com/"); driver.findElement(By.name("q")).sendKeys("SFSCon"); driver.findElement(By.cssSelector("[type=submit]")).click(); assertEquals(9, driver.findElement(By.cssSelector("#ires .g")).size()); To pass or to fail - that’s the question Flaky Tests Source: https://selenide.org/blog.html
  • 7. What are Flaky Tests? 7 ▸ What can go wrong? ▸ Which line of the code may break the test? To pass or to fail - that’s the question Flaky Tests Source: https://selenide.org/blog.html
  • 8. What are Flaky Tests? 8 driver.navigate().to("https://www.google.com/"); driver.findElement(By.name("q")).sendKeys("SFSCon"); driver.findElement(By.cssSelector("[type=submit]")).click(); assertEquals(9, driver.findElement(By.cssSelector("#ires .g")).size()); To pass or to fail - that’s the question Flaky Tests Source: https://selenide.org/blog.html
  • 9. What are Flaky Tests? 9 ▸ 4 matching elements - 2 of them are hidden ▸ Possible fix is to modify the third line of the code driver.findElement(By.name("btnK")).click(); To pass or to fail - that’s the question Flaky Tests
  • 10. What are Flaky Tests? 10 ▸ However, the flakiness is still present ▸ When filling a search bar - the dropdown list hides the first search button and another one shows up To pass or to fail - that’s the question Flaky Tests
  • 11. What are Flaky Tests? 11 One of the solution might be using a framework with smart built-in timeouts and retries ▸ In case of Selenide framework (free and open-source): @Test public void userCanLogin() { open("https://www.google.com"); $(byName("q")).setValue("selenide"); $("[name=btnK]").click(); $$("#ires .g").shouldHave(size(10)); } To pass or to fail - that’s the question Flaky Tests Source: https://selenide.org/
  • 13. Origins of Flaky Tests 13 There are many reasons why flaky tests may show up in your test pipelines ▸ Test Environment ・ Lack of memory and space, caching issues ・ Docker and Jenkins issues ▸ Connection ・ Requests and responses speed and their order ▸ Test Frameworks ・ Versions mismatch, dropped support, bugs Flaky Tests
  • 15. Origins of Flaky Tests 15 ▸ TypeError: _.filter is not a function ▸ Nothing is clickable ▸ Affects only automation ▸ Unstuck only after refresh ▸ Manually works fine Test Frameworks
  • 16. Origins of Flaky Tests 16 The root cause: ▸ Updating to Selenium 4.12.0 caused the issue #12659 where Selenium overwrites _ sign Test Frameworks
  • 17. Origins of Flaky Tests 17 ▸ It’s not always a good idea to blindly update all versions of frameworks in your project ・ Lost support (e.g. dropped java 8 support) ・ A new bug is introduced ▸ Version mismatch of frameworks is also a common issue ・ A new version may bring new requirements and changes in a code Test Frameworks
  • 19. Origins of Flaky Tests 19 Test Environment
  • 20. Origins of Flaky Tests 20 Rebuild a job helped to get it passed ▸ However, the job was still failing and passing in a random order What could go wrong? ▸ Lost Internet connection when pulling images or it met pulling limits ▸ Lost connection to a testing machine ▸ Lack of memory and space ▸ Error while building and deploying quickstarts for the app under test ▸ etc. Test Environment
  • 21. Origins of Flaky Tests 21 What actually happened ▸ An application deployed on OpenShift become unstable after a while ▸ Continuously stopping and restarting accompanied by the error Liveness probe failed ▸ The application’s pod on OpenShift didn’t show detailed error messages Test Environment
  • 22. Origins of Flaky Tests 22 It turned out that ▸ It was caused by the app’s pod exceeding its memory allocation on OpenShift ▸ The resources weren’t defined by default What helped us is to edit app’s deployment configuration to increase the memory allocation ▸ spec: resources: limits: cpu: "1" memory: 100Mi requests: cpu: 200m memory: 32Mi Test Environment
  • 23. Origins of Flaky Tests 23 ▸ Clean up clusters, terminate unnecessary machines, remove namespaces/projects; ▸ Keep track of internal shared repositories, their space and do clean up jobs; ▸ Do not create machines with large resources for low-cost work; Test Environment: Resources
  • 24. Origins of Flaky Tests 24 ▸ If you have pipelines in parallel using the same resources and sharing the same cluster ・ Avoid job deadlocks ・ Add checks, conditions, timeouts Test Environment: Automation
  • 25. Origins of Flaky Tests 25 ▸ Connection is stable ▸ VPN is up ▸ Nothing is overloading network ▸ No outages are happening Test Environment: Infrastructure
  • 26. CONFIDENTIAL designator V0000000 Application under test Origins of Flaky Tests 26
  • 27. Origins of Flaky Tests 27 Also, flaky tests occur due to changes such as new features or new bugs introduced by developers ▸ Performance ▸ Bugs in the application ▸ Runtimes Application under test
  • 28. Origins of Flaky Tests 28 ▸ The loading order of the modules was not explicitly defined ▸ Sometimes, rendering of the page was faster than modules get loaded ▸ It caused a missing Logout button and therefore failures of the tests Application under test
  • 29. Origins of Flaky Tests 29 ▸ A broken layout for drop-down menu ▸ Tests were mostly passing ▸ Tests are running in a background with no UI ▸ It required us to do a manual testing to find it Application under test
  • 31. Good Practices 31 ▸ Consider test frameworks with built-in timeouts and smart retries ▸ Do not use common locators but unique ones ▸ Collaborate with developers ▸ Beware of version updates Good Practices
  • 32. Good Practices 32 ▸ Keep an eye on infrastructure ・ Space, memory, hanging jobs and machines ▸ It’s always good to know your application under test ▸ Be familiar with the application infrastructure ・ To develop tests effectively with low cost ・ To decrease number of potential flaky tests and issues ・ Easily debug Good Practices
  • 33. CONFIDENTIAL designator V0000000 Flakiness consumes resources and time from the Product Team and this costs money. Conclusion 33
  • 35. CONFIDENTIAL designator V0000000 linkedin.com/company/red-hat youtube.com/user/RedHatVideos facebook.com/redhatinc twitter.com/RedHat 35 Red Hat is the world’s leading provider of enterprise open source software solutions. Award-winning support, training, and consulting services make Red Hat a trusted adviser to the Fortune 500. Thank you Flaky Tests - How to deal with them