aboutsummaryrefslogtreecommitdiffstats
path: root/tests/resilience/user_indexer.btm
blob: a80c2910d320e2acd1865166f2ea9a33970292d6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# sonar.web.javaAdditionalOpts=-javaagent:/path/to/byteman-3.0.10/lib/byteman.jar=script:/path/to/user_indexer.btm,boot:/path/to/byteman-3.0.10/lib/byteman.jar
# sonar.search.recovery.delayInMs=10000
# sonar.search.recovery.minAgeInMs=30000

RULE make indexing of users silently fail
CLASS org.sonar.server.user.index.UserIndexer
METHOD postCommit
COMPILE
AT ENTRY
BIND logins:Collection = $logins
IF logins.contains("error")
DO RETURN
ENDRULE

RULE make indexing of users fail
CLASS org.sonar.server.user.index.UserIndexer
METHOD postCommit
COMPILE
AT ENTRY
BIND logins:Collection = $logins
IF logins.contains("crash")
DO THROW new RuntimeException("Fail to index users to Elasticsearch because a user 'crash' has been given")
ENDRULE