Skip to content

Commit 485b82c

Browse files
authored
Update YAML Rest tests to check for product header on all responses (#83290) (#83993)
This PR adds assertions to YAML Rest tests to ensure that product headers are always returned in rest responses. Additional work has been included to fix a number of misuses of ThreadContext, mostly because of stashing listeners without their accompanying contexts. BWC Rest tests have been disabled for a few cases while the fixes are backported.
1 parent 5641159 commit 485b82c

File tree

21 files changed

+162
-73
lines changed

21 files changed

+162
-73
lines changed

docs/changelog/83290.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
pr: 83290
2+
summary: Update YAML Rest tests to check for product header on all responses
3+
area: Infra/REST API
4+
type: enhancement
5+
issues: []

modules/reindex/src/main/java/org/elasticsearch/reindex/AbstractAsyncBulkByScrollAction.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -593,7 +593,7 @@ protected void finishHim(Exception failure) {
593593
*/
594594
protected void finishHim(Exception failure, List<Failure> indexingFailures, List<SearchFailure> searchFailures, boolean timedOut) {
595595
logger.debug("[{}]: finishing without any catastrophic failures", task.getId());
596-
scrollSource.close(() -> {
596+
scrollSource.close(threadPool.getThreadContext().preserveContext(() -> {
597597
if (failure == null) {
598598
BulkByScrollResponse response = buildResponse(
599599
timeValueNanos(System.nanoTime() - startTime.get()),
@@ -605,7 +605,7 @@ protected void finishHim(Exception failure, List<Failure> indexingFailures, List
605605
} else {
606606
listener.onFailure(failure);
607607
}
608-
});
608+
}));
609609
}
610610

611611
/**

rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/cat.snapshots/10_basic.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@
2323
$/
2424
---
2525
"Test cat snapshots output":
26+
- skip:
27+
version: " - 8.1.99"
28+
reason: "Pause BWC tests until #83290 is backported"
29+
2630
- do:
2731
snapshot.create_repository:
2832
repository: test_cat_snapshots_1

rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/snapshot.clone/10_basic.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
---
22
setup:
3+
- skip:
4+
version: " - 8.1.99"
5+
reason: "Pause BWC tests until #83290 is backported"
36

47
- do:
58
snapshot.create_repository:

rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/snapshot.create/10_basic.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
---
22
setup:
3+
- skip:
4+
version: " - 8.1.99"
5+
reason: "Pause BWC tests until #83290 is backported"
36

47
- do:
58
snapshot.create_repository:

rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/snapshot.get/10_basic.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
---
22
setup:
3+
- skip:
4+
version: " - 8.1.99"
5+
reason: "Pause BWC tests until #83290 is backported"
36

47
- do:
58
snapshot.create_repository:
@@ -61,6 +64,7 @@ setup:
6164

6265
---
6366
"Get snapshot info when verbose is false":
67+
6468
- do:
6569
indices.create:
6670
index: test_index
@@ -198,7 +202,6 @@ setup:
198202
- skip:
199203
version: " - 7.12.99"
200204
reason: "Introduced in 7.13.0"
201-
202205
- do:
203206
indices.create:
204207
index: test_index

rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/snapshot.get_repository/20_repository_uuid.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
11
---
2+
setup:
3+
- skip:
4+
version: " - 8.1.99"
5+
reason: "Pause BWC tests until #83290 is backported"
6+
---
27
"Get repository returns UUID":
38
- skip:
49
version: " - 7.12.99"

rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/snapshot.restore/10_basic.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
---
22
setup:
3+
- skip:
4+
version: " - 8.1.99"
5+
reason: "Pause BWC tests until #83290 is backported"
36

47
- do:
58
snapshot.create_repository:

rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/snapshot.status/10_basic.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
---
22
setup:
3+
- skip:
4+
version: " - 8.1.99"
5+
reason: "Pause BWC tests until #83290 is backported"
36

47
- do:
58
snapshot.create_repository:

rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/tsdb/30_snapshot.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
---
22
setup:
3+
- skip:
4+
version: " - 8.1.99"
5+
reason: "Pause BWC tests until #83290 is backported"
6+
37
- do:
48
snapshot.create_repository:
59
repository: test_repo

0 commit comments

Comments
 (0)