diff --git a/buildSrc/src/main/groovy/org/elasticsearch/gradle/test/NodeInfo.groovy b/buildSrc/src/main/groovy/org/elasticsearch/gradle/test/NodeInfo.groovy index 9a91c5ba138..85af2debf1b 100644 --- a/buildSrc/src/main/groovy/org/elasticsearch/gradle/test/NodeInfo.groovy +++ b/buildSrc/src/main/groovy/org/elasticsearch/gradle/test/NodeInfo.groovy @@ -206,6 +206,9 @@ class NodeInfo { /** Returns the data directory for this node */ File getDataDir() { + if (!(dataDir instanceof File)) { + return new File(dataDir) + } return dataDir } diff --git a/qa/rolling-upgrade/build.gradle b/qa/rolling-upgrade/build.gradle index acc59bb3bed..456db46d666 100644 --- a/qa/rolling-upgrade/build.gradle +++ b/qa/rolling-upgrade/build.gradle @@ -39,7 +39,7 @@ task mixedClusterTest(type: RestIntegTestTask) { distribution = 'zip' clusterName = 'rolling-upgrade' unicastTransportUri = { seedNode, node, ant -> oldClusterTest.nodes.get(0).transportUri() } - dataDir = "${-> oldClusterTest.nodes[1].dataDir}" + dataDir = "${-> oldClusterTest.nodes[1].getDataDir()}" } systemProperty 'tests.rest.suite', 'mixed_cluster' @@ -51,7 +51,7 @@ task upgradedClusterTest(type: RestIntegTestTask) { distribution = 'zip' clusterName = 'rolling-upgrade' unicastTransportUri = { seedNode, node, ant -> mixedClusterTest.nodes.get(0).transportUri() } - dataDir = "${-> oldClusterTest.nodes[0].dataDir}" + dataDir = "${-> oldClusterTest.nodes[0].getDataDir()}" } systemProperty 'tests.rest.suite', 'upgraded_cluster' } diff --git a/qa/rolling-upgrade/src/test/resources/rest-api-spec/test/mixed_cluster/10_basic.yaml b/qa/rolling-upgrade/src/test/resources/rest-api-spec/test/mixed_cluster/10_basic.yaml index a46d7aaf044..dcfa946ed64 100644 --- a/qa/rolling-upgrade/src/test/resources/rest-api-spec/test/mixed_cluster/10_basic.yaml +++ b/qa/rolling-upgrade/src/test/resources/rest-api-spec/test/mixed_cluster/10_basic.yaml @@ -1,7 +1,13 @@ --- "Index data and search on the mixed cluster": - - do: - bulk: + - do: + search: + index: test_index + + - match: { hits.total: 5 } # no new indexed data, so expect the original 5 documents from the old cluster + + - do: + bulk: refresh: true body: - '{"index": {"_index": "test_index", "_type": "test_type"}}' @@ -19,4 +25,4 @@ search: index: test_index - - match: { hits.total: 10 } + - match: { hits.total: 10 } # 5 docs from old cluster, 5 docs from mixed cluster diff --git a/qa/rolling-upgrade/src/test/resources/rest-api-spec/test/upgraded_cluster/10_basic.yaml b/qa/rolling-upgrade/src/test/resources/rest-api-spec/test/upgraded_cluster/10_basic.yaml index edf9cb703d0..f6606c758a0 100644 --- a/qa/rolling-upgrade/src/test/resources/rest-api-spec/test/upgraded_cluster/10_basic.yaml +++ b/qa/rolling-upgrade/src/test/resources/rest-api-spec/test/upgraded_cluster/10_basic.yaml @@ -1,7 +1,13 @@ --- "Index data and search on the upgraded cluster": - - do: - bulk: + - do: + search: + index: test_index + + - match: { hits.total: 10 } # no new indexed data, so expect the original 10 documents from the old and mixed clusters + + - do: + bulk: refresh: true body: - '{"index": {"_index": "test_index", "_type": "test_type"}}' @@ -19,4 +25,4 @@ search: index: test_index - - match: { hits.total: 15 } + - match: { hits.total: 15 } # 10 docs from previous clusters plus 5 new docs