Skip to content

Instantly share code, notes, and snippets.

View ghenzler's full-sized avatar
🚀
Launching...

Georg Henzler ghenzler

🚀
Launching...
View GitHub Profile
@ghenzler
ghenzler / breaklet-base.groovy
Last active September 9, 2018 16:02
breaklet-base
// --------------------------------------------------------------------
// Breaklet Base Utilities (to be copied at bottom of other breaklets)
// --------------------------------------------------------------------
import org.apache.jackrabbit.commons.JcrUtils
import org.apache.commons.lang3.StringUtils
import java.util.concurrent.ThreadLocalRandom
import javax.jcr.query.*
import org.apache.sling.jcr.api.*
import org.apache.sling.api.resource.observation.*
import java.util.Properties
@ghenzler
ghenzler / breaklet-max-childnodes.groovy
Last active September 9, 2018 16:10
Checks how many child nodes can exist on same level
//-------------------------------------
// *** Max Child Nodes
//-------------------------------------
// Breaklet Config
//-------------------------------------
def breakForDurationInSec = 120
def basePath = "/content/nodetest"
def nodesToCreatePerIteration = 1000
def primaryType = "nt:unstructured" // "oak:Unstructured" => not orderable, "nt:unstructured" => orderable

Breaklets

The Idea

Breaklets are a way to check limits of a platform/aspect/tool. Breaklets

  • ... iteratively make things worse
  • ... run until either
    • a threshold is reached
//-------------------------------------
// *** Deep Group Hierarchies
// *** with functionality fragments
//-------------------------------------
// Breaklet Config
//-------------------------------------
def breakForDurationInSec = 60
def componentsOnTestPage = 10
def funcFragmentsPerIteration = 5
//-------------------------------------
// *** Max Components On Page
//-------------------------------------
// Breaklet Config
//-------------------------------------
def breakForDurationInSec = 300
def pathToEdit = "/content/we-retail/language-masters/en/about-us"
def componentToAdd = "weretail/components/content/text"
def compsPerIteration = 50
@ghenzler
ghenzler / breaklet-max-childnodes-with-composum-and-CRXDE.groovy
Created September 9, 2018 16:13
iteratively creates child nodes under same parent and displays them with chrome headless in CRXDE and Composium
//-------------------------------------
// *** Max Child Nodes
//. UI Test (CRXDE and Composum)
//-------------------------------------
// Breaklet Config
//-------------------------------------
def breakForDurationInSec = 120
def basePath = "/content/nodetest"
def nodesToCreatePerIteration = 1000
@ghenzler
ghenzler / breaklet-max-childnodes-wait-for-events.groovy
Created September 9, 2018 16:16
Creates many child nodes and waits for events
//-------------------------------------
// *** Max Child Nodes (Wait for Events)
//-------------------------------------
// Breaklet Config
//-------------------------------------
def breakForDurationInSec = 60
def basePath = "/content/nodetest"
def nodesToCreatePerIteration = 1000
def primaryType = "nt:unstructured" // "oak:Unstructured" => not orderable, "nt:unstructured" => orderable
@ghenzler
ghenzler / breaklet-max-sling-inheritance-levels.groovy
Created September 9, 2018 16:21
Checks how many script inheritance levels are possible
//-------------------------------------
// *** Max Inheritance Levels
//-------------------------------------
// Breaklet Config
//-------------------------------------
def breakForDurationInSec = 80
def componentsOnTestPage = 50
def inheritanceLevelsPerIteration = 10
@ghenzler
ghenzler / breaklet-deep-group-hierarchies.groovy
Created September 9, 2018 16:24
Increases continuously the group levels from user to ACE
//-------------------------------------
// *** Deep Group Hierarchies
//-------------------------------------
// Breaklet Config
//-------------------------------------
def breakForDurationInSec = 60
def componentsOnTestPage = 50
def groupHierarchiesPerIteration = 10
import org.apache.sling.hc.api.HealthCheck
//-------------------------------------
// Hostile Health Check
//-------------------------------------
// !!! Be careful, this creates a long-running health check blocking one
// thread of the HC thread pool. Unregister the hostile health check by
// creating a file "hc-unregister" in the current working dir (usually the
// dir next to crx-quickstart folder) and running the HC one more time