Skip to content

Commit 061c8bb

Browse files
authored
Fix ESQL match test flakiness by using regexes for error messages (elastic#126707)
1 parent 08beb53 commit 061c8bb

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

x-pack/plugin/src/yamlRestTest/resources/rest-api-spec/test/esql/180_match_operator.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ setup:
125125

126126
- match: { status: 400 }
127127
- match: { error.type: verification_exception }
128-
- match: { error.reason: "Found 1 problem\nline 1:19: Unknown column [something]" }
128+
- match: { error.reason: "/Unknown.column.\\[something\\]/" }
129129

130130
---
131131
"match on eval column":
@@ -139,7 +139,7 @@ setup:
139139

140140
- match: { status: 400 }
141141
- match: { error.type: verification_exception }
142-
- match: { error.reason: "Found 1 problem\nline 1:60: [:] operator cannot operate on [upper_content], which is not a field from an index mapping" }
142+
- match: { error.reason: "/operator.cannot.operate.on.\\[upper_content\\],.which.is.not.a.field.from.an.index.mapping/" }
143143

144144
---
145145
"match on overwritten column":
@@ -153,7 +153,7 @@ setup:
153153

154154
- match: { status: 400 }
155155
- match: { error.type: verification_exception }
156-
- match: { error.reason: "Found 1 problem\nline 1:78: [:] operator cannot operate on [content], which is not a field from an index mapping" }
156+
- match: { error.reason: "/operator.cannot.operate.on.\\[content\\],.which.is.not.a.field.from.an.index.mapping/" }
157157

158158
---
159159
"match after stats":
@@ -167,7 +167,7 @@ setup:
167167

168168
- match: { status: 400 }
169169
- match: { error.type: verification_exception }
170-
- match: { error.reason: "Found 1 problem\nline 1:36: Unknown column [content], did you mean [count(*)]?" }
170+
- match: { error.reason: "/Unknown.column.\\[content\\]/" }
171171

172172
---
173173
"match with disjunctions":
@@ -199,4 +199,4 @@ setup:
199199

200200
- match: { status: 400 }
201201
- match: { error.type: verification_exception }
202-
- match: { error.reason: "Found 1 problem\nline 1:34: [:] operator is only supported in WHERE commands" }
202+
- match: { error.reason: "/operator.is.only.supported.in.WHERE.commands/" }

0 commit comments

Comments
 (0)