diff --git a/muted-tests.yml b/muted-tests.yml index 186b2f2b8b90a..79c916d9a348e 100644 --- a/muted-tests.yml +++ b/muted-tests.yml @@ -66,9 +66,6 @@ tests: - class: org.elasticsearch.xpack.test.rest.XPackRestIT method: test {p0=transform/transforms_start_stop/Test start already started transform} issue: https://github.com/elastic/elasticsearch/issues/98802 -- class: org.elasticsearch.xpack.deprecation.DeprecationHttpIT - method: testDeprecatedSettingsReturnWarnings - issue: https://github.com/elastic/elasticsearch/issues/108628 - class: org.elasticsearch.xpack.shutdown.NodeShutdownIT method: testAllocationPreventedForRemoval issue: https://github.com/elastic/elasticsearch/issues/116363 diff --git a/server/src/main/java/org/elasticsearch/cluster/service/MasterService.java b/server/src/main/java/org/elasticsearch/cluster/service/MasterService.java index c46b3b7d66183..05fa03283d065 100644 --- a/server/src/main/java/org/elasticsearch/cluster/service/MasterService.java +++ b/server/src/main/java/org/elasticsearch/cluster/service/MasterService.java @@ -913,7 +913,7 @@ public void onFailure(Exception failure) { @Override public Releasable captureResponseHeaders() { - final var storedContext = threadContext.newStoredContext(); + final var storedContext = threadContextSupplier.get(); return Releasables.wrap(() -> { final var newResponseHeaders = threadContext.getResponseHeaders(); if (newResponseHeaders.isEmpty()) { diff --git a/server/src/test/java/org/elasticsearch/cluster/service/MasterServiceTests.java b/server/src/test/java/org/elasticsearch/cluster/service/MasterServiceTests.java index 0fecccc3cb5e6..4c24abbd5fd9a 100644 --- a/server/src/test/java/org/elasticsearch/cluster/service/MasterServiceTests.java +++ b/server/src/test/java/org/elasticsearch/cluster/service/MasterServiceTests.java @@ -299,7 +299,6 @@ public void testThreadContext() { } try (ThreadContext.StoredContext ignored = threadPool.getThreadContext().stashContext()) { - final var expectedHeaders = new HashMap(); expectedHeaders.put(randomIdentifier(), randomIdentifier()); for (final var copiedHeader : Task.HEADERS_TO_COPY) { @@ -319,8 +318,10 @@ public void testThreadContext() { new AckedClusterStateUpdateTask(ackedRequest(ackTimeout, masterTimeout), null) { @Override public ClusterState execute(ClusterState currentState) { - assertTrue(threadPool.getThreadContext().isSystemContext()); - assertEquals(Collections.emptyMap(), threadPool.getThreadContext().getHeaders()); + // the task is executed in the context in which the task was originally created. + // note: this is typically not a system context. + assertExpectedThreadContext(Map.of()); + expectedResponseHeaders.forEach( (name, values) -> values.forEach(v -> threadPool.getThreadContext().addResponseHeader(name, v)) ); diff --git a/x-pack/plugin/build.gradle b/x-pack/plugin/build.gradle index 7adcf50a256e2..7605c8060f873 100644 --- a/x-pack/plugin/build.gradle +++ b/x-pack/plugin/build.gradle @@ -105,7 +105,11 @@ tasks.named("yamlRestCompatTestTransform").configure({ task -> task.skipTest("esql/130_spatial/values unsupported for geo_point", "Spatial types are now supported in VALUES aggregation") task.skipTest("esql/130_spatial/values unsupported for geo_point status code", "Spatial types are now supported in VALUES aggregation") // Expected deprecation warning to compat yaml tests: - task.addAllowedWarningRegex(".*rollup functionality will be removed in Elasticsearch.*") + task.addAllowedWarningRegex( + ".*rollup functionality will be removed in Elasticsearch.*", + // https://github.com/elastic/elasticsearch/issues/127911 + "Index \\[\\.profiling-.*\\] name begins with a dot.* and will not be allowed in a future Elasticsearch version." + ) task.skipTest("esql/40_tsdb/from doc with aggregate_metric_double", "TODO: support for subset of metric fields") task.skipTest("esql/40_tsdb/stats on aggregate_metric_double", "TODO: support for subset of metric fields") task.skipTest("esql/40_tsdb/from index pattern unsupported counter", "TODO: support for subset of metric fields") diff --git a/x-pack/plugin/src/yamlRestTest/resources/rest-api-spec/test/profiling/10_basic.yml b/x-pack/plugin/src/yamlRestTest/resources/rest-api-spec/test/profiling/10_basic.yml index 9996f67c4ecb6..f026bcebc2a09 100644 --- a/x-pack/plugin/src/yamlRestTest/resources/rest-api-spec/test/profiling/10_basic.yml +++ b/x-pack/plugin/src/yamlRestTest/resources/rest-api-spec/test/profiling/10_basic.yml @@ -1,10 +1,14 @@ --- setup: - requires: + test_runner_features: [ "allowed_warnings_regex" ] cluster_features: ["gte_v8.13.0"] reason: "Universal Profiling test infrastructure is available in 8.12+" - do: + allowed_warnings_regex: + # https://github.com/elastic/elasticsearch/issues/127911 + - "Index \\[\\.profiling-.*\\] name begins with a dot .* and will not be allowed in a future Elasticsearch version." cluster.put_settings: body: persistent: