{"action":"created","comment":{"url":"https://api.github.com/repos/elastic/elasticsearch/pulls/comments/66621054","id":66621054,"diff_hunk":"@@ -32,23 +32,30 @@\n import org.elasticsearch.cluster.metadata.MetaData;\n import org.elasticsearch.common.settings.Settings;\n import org.elasticsearch.test.ESTestCase;\n+import org.junit.BeforeClass;\n \n import static org.hamcrest.Matchers.containsString;\n \n /**\n  * Tests that indexing from an index back into itself fails the request.\n  */\n public class ReindexSameIndexTests extends ESTestCase {\n-    private static final ClusterState STATE = ClusterState.builder(new ClusterName(\"test\")).metaData(MetaData.builder()\n-                .put(index(\"target\", \"target_alias\", \"target_multi\"), true)\n-                .put(index(\"target2\", \"target_multi\"), true)\n-                .put(index(\"foo\"), true)\n-                .put(index(\"bar\"), true)\n-                .put(index(\"baz\"), true)\n-                .put(index(\"source\", \"source_multi\"), true)\n-                .put(index(\"source2\", \"source_multi\"), true)).build();\n+\n+    private static ClusterState STATE;\n     private static final IndexNameExpressionResolver INDEX_NAME_EXPRESSION_RESOLVER = new IndexNameExpressionResolver(Settings.EMPTY);\n-    private static final AutoCreateIndex AUTO_CREATE_INDEX = new AutoCreateIndex(Settings.EMPTY, INDEX_NAME_EXPRESSION_RESOLVER);\n+    private static AutoCreateIndex AUTO_CREATE_INDEX = new AutoCreateIndex(Settings.EMPTY, INDEX_NAME_EXPRESSION_RESOLVER);","path":"modules/reindex/src/test/java/org/elasticsearch/index/reindex/ReindexSameIndexTests.java","position":24,"original_position":24,"commit_id":"c3a9cf6b29cad84e29187a82a4abedec680570cf","original_commit_id":"406a3d732de3aad2d8ef67c199cce0f5121b73cc","user":{"login":"jasontedor","id":4744941,"avatar_url":"https://avatars.githubusercontent.com/u/4744941?v=3","gravatar_id":"","url":"https://api.github.com/users/jasontedor","html_url":"https://github.com/jasontedor","followers_url":"https://api.github.com/users/jasontedor/followers","following_url":"https://api.github.com/users/jasontedor/following{/other_user}","gists_url":"https://api.github.com/users/jasontedor/gists{/gist_id}","starred_url":"https://api.github.com/users/jasontedor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jasontedor/subscriptions","organizations_url":"https://api.github.com/users/jasontedor/orgs","repos_url":"https://api.github.com/users/jasontedor/repos","events_url":"https://api.github.com/users/jasontedor/events{/privacy}","received_events_url":"https://api.github.com/users/jasontedor/received_events","type":"User","site_admin":false},"body":"I forgot to come back and do this before merging this PR so I pushed 6d8692576e49ed9d4d570e1631a25f015f271cb8 directly to master.","created_at":"2016-06-10T14:21:39Z","updated_at":"2016-06-10T14:21:40Z","html_url":"https://github.com/elastic/elasticsearch/pull/18808#discussion_r66621054","pull_request_url":"https://api.github.com/repos/elastic/elasticsearch/pulls/18808","_links":{"self":{"href":"https://api.github.com/repos/elastic/elasticsearch/pulls/comments/66621054"},"html":{"href":"https://github.com/elastic/elasticsearch/pull/18808#discussion_r66621054"},"pull_request":{"href":"https://api.github.com/repos/elastic/elasticsearch/pulls/18808"}}},"pull_request":{"url":"https://api.github.com/repos/elastic/elasticsearch/pulls/18808","id":73262870,"html_url":"https://github.com/elastic/elasticsearch/pull/18808","diff_url":"https://github.com/elastic/elasticsearch/pull/18808.diff","patch_url":"https://github.com/elastic/elasticsearch/pull/18808.patch","issue_url":"https://api.github.com/repos/elastic/elasticsearch/issues/18808","number":18808,"state":"closed","locked":false,"title":"Make random UUIDs reproducible in tests","user":{"login":"jasontedor","id":4744941,"avatar_url":"https://avatars.githubusercontent.com/u/4744941?v=3","gravatar_id":"","url":"https://api.github.com/users/jasontedor","html_url":"https://github.com/jasontedor","followers_url":"https://api.github.com/users/jasontedor/followers","following_url":"https://api.github.com/users/jasontedor/following{/other_user}","gists_url":"https://api.github.com/users/jasontedor/gists{/gist_id}","starred_url":"https://api.github.com/users/jasontedor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jasontedor/subscriptions","organizations_url":"https://api.github.com/users/jasontedor/orgs","repos_url":"https://api.github.com/users/jasontedor/repos","events_url":"https://api.github.com/users/jasontedor/events{/privacy}","received_events_url":"https://api.github.com/users/jasontedor/received_events","type":"User","site_admin":false},"body":"Today we use a random source of UUIDs for assigning allocation IDs,\r\ncluster IDs, etc. Yet, the source of randomness for this is not\r\nreproducible in tests. Since allocation IDs end up as keys in hash maps,\r\nthis means allocation decisions and not reproducible in tests and this\r\nleads to non-reproducible test failures. This commit modifies the\r\nbehavior of random UUIDs so that they are reproducible under tests. The\r\nbehavior for production code is not changed, we still use a true source\r\nof secure randomness but under tests we just use a reproducible source\r\nof non-secure randomness.\r\n\r\nIt is important to note that there is a test,\r\nUUIDTests#testThreadedRandomUUID that relies on the UUIDs being truly\r\nrandom. Thus, we have to modify the setup for this test to use a true\r\nsource of randomness. Thus, this is one test that will never be\r\nreproducible but it is intentionally so.\r\n","created_at":"2016-06-09T18:29:47Z","updated_at":"2016-06-10T14:21:40Z","closed_at":"2016-06-10T14:18:06Z","merged_at":"2016-06-10T14:18:06Z","merge_commit_sha":"a25b8ee1bf2e70bc28f688731ef43962a3ef18ce","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/elastic/elasticsearch/pulls/18808/commits","review_comments_url":"https://api.github.com/repos/elastic/elasticsearch/pulls/18808/comments","review_comment_url":"https://api.github.com/repos/elastic/elasticsearch/pulls/comments{/number}","comments_url":"https://api.github.com/repos/elastic/elasticsearch/issues/18808/comments","statuses_url":"https://api.github.com/repos/elastic/elasticsearch/statuses/c3a9cf6b29cad84e29187a82a4abedec680570cf","head":{"label":"jasontedor:reproducible-uuid","ref":"reproducible-uuid","sha":"c3a9cf6b29cad84e29187a82a4abedec680570cf","user":{"login":"jasontedor","id":4744941,"avatar_url":"https://avatars.githubusercontent.com/u/4744941?v=3","gravatar_id":"","url":"https://api.github.com/users/jasontedor","html_url":"https://github.com/jasontedor","followers_url":"https://api.github.com/users/jasontedor/followers","following_url":"https://api.github.com/users/jasontedor/following{/other_user}","gists_url":"https://api.github.com/users/jasontedor/gists{/gist_id}","starred_url":"https://api.github.com/users/jasontedor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jasontedor/subscriptions","organizations_url":"https://api.github.com/users/jasontedor/orgs","repos_url":"https://api.github.com/users/jasontedor/repos","events_url":"https://api.github.com/users/jasontedor/events{/privacy}","received_events_url":"https://api.github.com/users/jasontedor/received_events","type":"User","site_admin":false},"repo":{"id":38618383,"name":"elasticsearch","full_name":"jasontedor/elasticsearch","owner":{"login":"jasontedor","id":4744941,"avatar_url":"https://avatars.githubusercontent.com/u/4744941?v=3","gravatar_id":"","url":"https://api.github.com/users/jasontedor","html_url":"https://github.com/jasontedor","followers_url":"https://api.github.com/users/jasontedor/followers","following_url":"https://api.github.com/users/jasontedor/following{/other_user}","gists_url":"https://api.github.com/users/jasontedor/gists{/gist_id}","starred_url":"https://api.github.com/users/jasontedor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jasontedor/subscriptions","organizations_url":"https://api.github.com/users/jasontedor/orgs","repos_url":"https://api.github.com/users/jasontedor/repos","events_url":"https://api.github.com/users/jasontedor/events{/privacy}","received_events_url":"https://api.github.com/users/jasontedor/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jasontedor/elasticsearch","description":"Open Source, Distributed, RESTful Search Engine","fork":true,"url":"https://api.github.com/repos/jasontedor/elasticsearch","forks_url":"https://api.github.com/repos/jasontedor/elasticsearch/forks","keys_url":"https://api.github.com/repos/jasontedor/elasticsearch/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jasontedor/elasticsearch/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jasontedor/elasticsearch/teams","hooks_url":"https://api.github.com/repos/jasontedor/elasticsearch/hooks","issue_events_url":"https://api.github.com/repos/jasontedor/elasticsearch/issues/events{/number}","events_url":"https://api.github.com/repos/jasontedor/elasticsearch/events","assignees_url":"https://api.github.com/repos/jasontedor/elasticsearch/assignees{/user}","branches_url":"https://api.github.com/repos/jasontedor/elasticsearch/branches{/branch}","tags_url":"https://api.github.com/repos/jasontedor/elasticsearch/tags","blobs_url":"https://api.github.com/repos/jasontedor/elasticsearch/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jasontedor/elasticsearch/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jasontedor/elasticsearch/git/refs{/sha}","trees_url":"https://api.github.com/repos/jasontedor/elasticsearch/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jasontedor/elasticsearch/statuses/{sha}","languages_url":"https://api.github.com/repos/jasontedor/elasticsearch/languages","stargazers_url":"https://api.github.com/repos/jasontedor/elasticsearch/stargazers","contributors_url":"https://api.github.com/repos/jasontedor/elasticsearch/contributors","subscribers_url":"https://api.github.com/repos/jasontedor/elasticsearch/subscribers","subscription_url":"https://api.github.com/repos/jasontedor/elasticsearch/subscription","commits_url":"https://api.github.com/repos/jasontedor/elasticsearch/commits{/sha}","git_commits_url":"https://api.github.com/repos/jasontedor/elasticsearch/git/commits{/sha}","comments_url":"https://api.github.com/repos/jasontedor/elasticsearch/comments{/number}","issue_comment_url":"https://api.github.com/repos/jasontedor/elasticsearch/issues/comments{/number}","contents_url":"https://api.github.com/repos/jasontedor/elasticsearch/contents/{+path}","compare_url":"https://api.github.com/repos/jasontedor/elasticsearch/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jasontedor/elasticsearch/merges","archive_url":"https://api.github.com/repos/jasontedor/elasticsearch/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jasontedor/elasticsearch/downloads","issues_url":"https://api.github.com/repos/jasontedor/elasticsearch/issues{/number}","pulls_url":"https://api.github.com/repos/jasontedor/elasticsearch/pulls{/number}","milestones_url":"https://api.github.com/repos/jasontedor/elasticsearch/milestones{/number}","notifications_url":"https://api.github.com/repos/jasontedor/elasticsearch/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jasontedor/elasticsearch/labels{/name}","releases_url":"https://api.github.com/repos/jasontedor/elasticsearch/releases{/id}","deployments_url":"https://api.github.com/repos/jasontedor/elasticsearch/deployments","created_at":"2015-07-06T12:48:14Z","updated_at":"2015-07-06T12:48:36Z","pushed_at":"2016-06-10T14:18:09Z","git_url":"git://github.com/jasontedor/elasticsearch.git","ssh_url":"git@github.com:jasontedor/elasticsearch.git","clone_url":"https://github.com/jasontedor/elasticsearch.git","svn_url":"https://github.com/jasontedor/elasticsearch","homepage":"https://www.elastic.co/products/elasticsearch","size":217552,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"elastic:master","ref":"master","sha":"e02d9f09455f5a7f12f9966d1e2a3032e5cf907e","user":{"login":"elastic","id":6764390,"avatar_url":"https://avatars.githubusercontent.com/u/6764390?v=3","gravatar_id":"","url":"https://api.github.com/users/elastic","html_url":"https://github.com/elastic","followers_url":"https://api.github.com/users/elastic/followers","following_url":"https://api.github.com/users/elastic/following{/other_user}","gists_url":"https://api.github.com/users/elastic/gists{/gist_id}","starred_url":"https://api.github.com/users/elastic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/elastic/subscriptions","organizations_url":"https://api.github.com/users/elastic/orgs","repos_url":"https://api.github.com/users/elastic/repos","events_url":"https://api.github.com/users/elastic/events{/privacy}","received_events_url":"https://api.github.com/users/elastic/received_events","type":"Organization","site_admin":false},"repo":{"id":507775,"name":"elasticsearch","full_name":"elastic/elasticsearch","owner":{"login":"elastic","id":6764390,"avatar_url":"https://avatars.githubusercontent.com/u/6764390?v=3","gravatar_id":"","url":"https://api.github.com/users/elastic","html_url":"https://github.com/elastic","followers_url":"https://api.github.com/users/elastic/followers","following_url":"https://api.github.com/users/elastic/following{/other_user}","gists_url":"https://api.github.com/users/elastic/gists{/gist_id}","starred_url":"https://api.github.com/users/elastic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/elastic/subscriptions","organizations_url":"https://api.github.com/users/elastic/orgs","repos_url":"https://api.github.com/users/elastic/repos","events_url":"https://api.github.com/users/elastic/events{/privacy}","received_events_url":"https://api.github.com/users/elastic/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/elastic/elasticsearch","description":"Open Source, Distributed, RESTful Search Engine","fork":false,"url":"https://api.github.com/repos/elastic/elasticsearch","forks_url":"https://api.github.com/repos/elastic/elasticsearch/forks","keys_url":"https://api.github.com/repos/elastic/elasticsearch/keys{/key_id}","collaborators_url":"https://api.github.com/repos/elastic/elasticsearch/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/elastic/elasticsearch/teams","hooks_url":"https://api.github.com/repos/elastic/elasticsearch/hooks","issue_events_url":"https://api.github.com/repos/elastic/elasticsearch/issues/events{/number}","events_url":"https://api.github.com/repos/elastic/elasticsearch/events","assignees_url":"https://api.github.com/repos/elastic/elasticsearch/assignees{/user}","branches_url":"https://api.github.com/repos/elastic/elasticsearch/branches{/branch}","tags_url":"https://api.github.com/repos/elastic/elasticsearch/tags","blobs_url":"https://api.github.com/repos/elastic/elasticsearch/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/elastic/elasticsearch/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/elastic/elasticsearch/git/refs{/sha}","trees_url":"https://api.github.com/repos/elastic/elasticsearch/git/trees{/sha}","statuses_url":"https://api.github.com/repos/elastic/elasticsearch/statuses/{sha}","languages_url":"https://api.github.com/repos/elastic/elasticsearch/languages","stargazers_url":"https://api.github.com/repos/elastic/elasticsearch/stargazers","contributors_url":"https://api.github.com/repos/elastic/elasticsearch/contributors","subscribers_url":"https://api.github.com/repos/elastic/elasticsearch/subscribers","subscription_url":"https://api.github.com/repos/elastic/elasticsearch/subscription","commits_url":"https://api.github.com/repos/elastic/elasticsearch/commits{/sha}","git_commits_url":"https://api.github.com/repos/elastic/elasticsearch/git/commits{/sha}","comments_url":"https://api.github.com/repos/elastic/elasticsearch/comments{/number}","issue_comment_url":"https://api.github.com/repos/elastic/elasticsearch/issues/comments{/number}","contents_url":"https://api.github.com/repos/elastic/elasticsearch/contents/{+path}","compare_url":"https://api.github.com/repos/elastic/elasticsearch/compare/{base}...{head}","merges_url":"https://api.github.com/repos/elastic/elasticsearch/merges","archive_url":"https://api.github.com/repos/elastic/elasticsearch/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/elastic/elasticsearch/downloads","issues_url":"https://api.github.com/repos/elastic/elasticsearch/issues{/number}","pulls_url":"https://api.github.com/repos/elastic/elasticsearch/pulls{/number}","milestones_url":"https://api.github.com/repos/elastic/elasticsearch/milestones{/number}","notifications_url":"https://api.github.com/repos/elastic/elasticsearch/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/elastic/elasticsearch/labels{/name}","releases_url":"https://api.github.com/repos/elastic/elasticsearch/releases{/id}","deployments_url":"https://api.github.com/repos/elastic/elasticsearch/deployments","created_at":"2010-02-08T13:20:56Z","updated_at":"2016-06-10T13:10:17Z","pushed_at":"2016-06-10T14:21:11Z","git_url":"git://github.com/elastic/elasticsearch.git","ssh_url":"git@github.com:elastic/elasticsearch.git","clone_url":"https://github.com/elastic/elasticsearch.git","svn_url":"https://github.com/elastic/elasticsearch","homepage":"https://www.elastic.co/products/elasticsearch","size":323676,"stargazers_count":16890,"watchers_count":16890,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":5709,"mirror_url":null,"open_issues_count":1066,"forks":5709,"open_issues":1066,"watchers":16890,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/elastic/elasticsearch/pulls/18808"},"html":{"href":"https://github.com/elastic/elasticsearch/pull/18808"},"issue":{"href":"https://api.github.com/repos/elastic/elasticsearch/issues/18808"},"comments":{"href":"https://api.github.com/repos/elastic/elasticsearch/issues/18808/comments"},"review_comments":{"href":"https://api.github.com/repos/elastic/elasticsearch/pulls/18808/comments"},"review_comment":{"href":"https://api.github.com/repos/elastic/elasticsearch/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/elastic/elasticsearch/pulls/18808/commits"},"statuses":{"href":"https://api.github.com/repos/elastic/elasticsearch/statuses/c3a9cf6b29cad84e29187a82a4abedec680570cf"}}}}
{"actor":{"display_login":"jasontedor"}}