{"action":"created","comment":{"url":"https://api.github.com/repos/apache/flink/pulls/comments/80233334","id":80233334,"diff_hunk":"@@ -178,89 +166,122 @@ public static void startCassandra() throws IOException {\n \t\t}\n \t\tscanner.close();\n \n-\n-\t\t// Tell cassandra where the configuration files are.\n-\t\t// Use the test configuration file.\n-\t\tSystem.setProperty(\"cassandra.config\", tmp.getAbsoluteFile().toURI().toString());\n-\n \t\tif (EMBEDDED) {\n-\t\t\tcassandra = new EmbeddedCassandraService();\n-\t\t\tcassandra.start();\n+\t\t\tString javaCommand = getJavaCommandPath();\n+\n+\t\t\t// create a logging file for the process\n+\t\t\tFile tempLogFile = File.createTempFile(\"testlogconfig\", \"properties\");\n+\t\t\tCommonTestUtils.printLog4jDebugConfig(tempLogFile);\n+\n+\t\t\t// start the task manager process\n+\t\t\tString[] command = new String[]{\n+\t\t\t\tjavaCommand,\n+\t\t\t\t\"-Dlog.level=DEBUG\",\n+\t\t\t\t\"-Dlog4j.configuration=file:\" + tempLogFile.getAbsolutePath(),\n+\t\t\t\t\"-Dcassandra.config=\" + tmp.toURI(),\n+\t\t\t\t// these options were taken directly from the jvm.options file in the cassandra repo\n+\t\t\t\t\"-XX:+UseThreadPriorities\",\n+\t\t\t\t\"-Xss256k\",\n+\t\t\t\t\"-XX:+AlwaysPreTouch\",\n+\t\t\t\t\"-XX:+UseTLAB\",\n+\t\t\t\t\"-XX:+ResizeTLAB\",\n+\t\t\t\t\"-XX:+UseNUMA\",\n+\t\t\t\t\"-XX:+PerfDisableSharedMem\",\n+\t\t\t\t\"-XX:+UseParNewGC\",\n+\t\t\t\t\"-XX:+UseConcMarkSweepGC\",\n+\t\t\t\t\"-XX:+CMSParallelRemarkEnabled\",\n+\t\t\t\t\"-XX:SurvivorRatio=8\",\n+\t\t\t\t\"-XX:MaxTenuringThreshold=1\",\n+\t\t\t\t\"-XX:CMSInitiatingOccupancyFraction=75\",\n+\t\t\t\t\"-XX:+UseCMSInitiatingOccupancyOnly\",\n+\t\t\t\t\"-XX:CMSWaitDuration=10000\",\n+\t\t\t\t\"-XX:+CMSParallelInitialMarkEnabled\",\n+\t\t\t\t\"-XX:+CMSEdenChunksRecordAlways\",\n+\t\t\t\t\"-XX:+CMSClassUnloadingEnabled\",\n+\n+\t\t\t\t\"-classpath\", getCurrentClasspath(),\n+\t\t\t\tEmbeddedCassandraService.class.getName()\n+\t\t\t};\n+\n+\t\t\tProcessBuilder bld = new ProcessBuilder(command);\n+\t\t\tcassandra = bld.start();\n+\t\t\tsw = new StringWriter();\n+\t\t\tnew PipeForwarder(cassandra.getErrorStream(), sw);\n \t\t}\n \n-\t\ttry {\n-\t\t\tThread.sleep(1000 * 10);\n-\t\t} catch (InterruptedException e) { //give cassandra a few seconds to start up\n+\t\tint attempt = 0;\n+\t\twhile (true) {\n+\t\t\ttry {\n+\t\t\t\tattempt++;\n+\t\t\t\tcluster = builder.getCluster();\n+\t\t\t\tsession = cluster.connect();\n+\t\t\t\tbreak;\n+\t\t\t} catch (Exception e) {\n+\t\t\t\tif (attempt > 30) {\n+\t\t\t\t\tthrow e;\n+\t\t\t\t}\n+\t\t\t\ttry {\n+\t\t\t\t\tThread.sleep(1000);\n+\t\t\t\t} catch (InterruptedException e1) {\n+\t\t\t\t}\n+\t\t\t}\n \t\t}\n-\n-\t\tcluster = builder.getCluster();\n-\t\tsession = cluster.connect();\n+\t\tLOG.debug(\"Connection established after \" + attempt + \" attempts.\");\n \n \t\tsession.execute(CREATE_KEYSPACE_QUERY);\n-\t\tsession.execute(CREATE_TABLE_QUERY);\n-\t}\n-\n-\t@BeforeClass\n-\tpublic static void startFlink() throws Exception {\n-\t\tConfiguration config = new Configuration();\n-\t\tconfig.setInteger(ConfigConstants.TASK_MANAGER_NUM_TASK_SLOTS, 4);\n+\t\tsession.execute(CREATE_TABLE_QUERY.replace(\"$TABLE\", \"flink_initial\"));\n \n-\t\tflinkCluster = new ForkableFlinkMiniCluster(config);\n-\t\tflinkCluster.start();\n+\t\ttry {\n+\t\t\tThread.sleep(5000);","path":"flink-streaming-connectors/flink-connector-cassandra/src/test/java/org/apache/flink/streaming/connectors/cassandra/CassandraConnectorITCase.java","position":231,"original_position":231,"commit_id":"fbf99d660b832f9f0969185ebf84026d5406251f","original_commit_id":"fbf99d660b832f9f0969185ebf84026d5406251f","user":{"login":"zentol","id":5725237,"avatar_url":"https://avatars.githubusercontent.com/u/5725237?v=3","gravatar_id":"","url":"https://api.github.com/users/zentol","html_url":"https://github.com/zentol","followers_url":"https://api.github.com/users/zentol/followers","following_url":"https://api.github.com/users/zentol/following{/other_user}","gists_url":"https://api.github.com/users/zentol/gists{/gist_id}","starred_url":"https://api.github.com/users/zentol/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zentol/subscriptions","organizations_url":"https://api.github.com/users/zentol/orgs","repos_url":"https://api.github.com/users/zentol/repos","events_url":"https://api.github.com/users/zentol/events{/privacy}","received_events_url":"https://api.github.com/users/zentol/received_events","type":"User","site_admin":false},"body":"the execute() call is synchronous, it's not about making sure that it is complete. I just found that giving Cassandra a bit of time after creating the keyspace and the first table resulted in a higher stability.","created_at":"2016-09-23T12:19:50Z","updated_at":"2016-09-23T12:19:50Z","html_url":"https://github.com/apache/flink/pull/2484#discussion_r80233334","pull_request_url":"https://api.github.com/repos/apache/flink/pulls/2484","_links":{"self":{"href":"https://api.github.com/repos/apache/flink/pulls/comments/80233334"},"html":{"href":"https://github.com/apache/flink/pull/2484#discussion_r80233334"},"pull_request":{"href":"https://api.github.com/repos/apache/flink/pulls/2484"}}},"pull_request":{"url":"https://api.github.com/repos/apache/flink/pulls/2484","id":84632396,"html_url":"https://github.com/apache/flink/pull/2484","diff_url":"https://github.com/apache/flink/pull/2484.diff","patch_url":"https://github.com/apache/flink/pull/2484.patch","issue_url":"https://api.github.com/repos/apache/flink/issues/2484","number":2484,"state":"open","locked":false,"title":"[FLINK-4177] Harden CassandraConnectorTest","user":{"login":"zentol","id":5725237,"avatar_url":"https://avatars.githubusercontent.com/u/5725237?v=3","gravatar_id":"","url":"https://api.github.com/users/zentol","html_url":"https://github.com/zentol","followers_url":"https://api.github.com/users/zentol/followers","following_url":"https://api.github.com/users/zentol/following{/other_user}","gists_url":"https://api.github.com/users/zentol/gists{/gist_id}","starred_url":"https://api.github.com/users/zentol/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zentol/subscriptions","organizations_url":"https://api.github.com/users/zentol/orgs","repos_url":"https://api.github.com/users/zentol/repos","events_url":"https://api.github.com/users/zentol/events{/privacy}","received_events_url":"https://api.github.com/users/zentol/received_events","type":"User","site_admin":false},"body":"This PR (hopefully) resolves the instability issues with the Cassandra connector tests.\r\n\r\nChangelog:\r\n* updated cassandra/driver versions\r\n* the `cassandra.yaml` was cleaned up\r\n * removed several configuration values that used the default\r\n * sorted the remaining settings in alphabetical order\r\n* the at-least-once sinks were modified to\r\n * properly log exceptions when close() is called\r\n * keep track of how many records were not acknowledged yet\r\n* the tests were modified to\r\n * start the embedded cassandra instance in a separate process\r\n   * and supply an array of performance related jvm arguments, taken from the cassandra repo\r\n * no longer truncate tables; instead every test uses a separate table\r\n * wait until a connection could be established to cassandra in a retry-loop instead of waiting for a fixed time\r\n * no longer run actual flink jobs\r\n * use increased timeouts\r\n * clean up temporary files","created_at":"2016-09-09T11:03:21Z","updated_at":"2016-09-23T12:19:50Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/apache/flink/pulls/2484/commits","review_comments_url":"https://api.github.com/repos/apache/flink/pulls/2484/comments","review_comment_url":"https://api.github.com/repos/apache/flink/pulls/comments{/number}","comments_url":"https://api.github.com/repos/apache/flink/issues/2484/comments","statuses_url":"https://api.github.com/repos/apache/flink/statuses/fbf99d660b832f9f0969185ebf84026d5406251f","head":{"label":"zentol:cass_tmp","ref":"cass_tmp","sha":"fbf99d660b832f9f0969185ebf84026d5406251f","user":{"login":"zentol","id":5725237,"avatar_url":"https://avatars.githubusercontent.com/u/5725237?v=3","gravatar_id":"","url":"https://api.github.com/users/zentol","html_url":"https://github.com/zentol","followers_url":"https://api.github.com/users/zentol/followers","following_url":"https://api.github.com/users/zentol/following{/other_user}","gists_url":"https://api.github.com/users/zentol/gists{/gist_id}","starred_url":"https://api.github.com/users/zentol/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zentol/subscriptions","organizations_url":"https://api.github.com/users/zentol/orgs","repos_url":"https://api.github.com/users/zentol/repos","events_url":"https://api.github.com/users/zentol/events{/privacy}","received_events_url":"https://api.github.com/users/zentol/received_events","type":"User","site_admin":false},"repo":{"id":20647396,"name":"flink","full_name":"zentol/flink","owner":{"login":"zentol","id":5725237,"avatar_url":"https://avatars.githubusercontent.com/u/5725237?v=3","gravatar_id":"","url":"https://api.github.com/users/zentol","html_url":"https://github.com/zentol","followers_url":"https://api.github.com/users/zentol/followers","following_url":"https://api.github.com/users/zentol/following{/other_user}","gists_url":"https://api.github.com/users/zentol/gists{/gist_id}","starred_url":"https://api.github.com/users/zentol/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zentol/subscriptions","organizations_url":"https://api.github.com/users/zentol/orgs","repos_url":"https://api.github.com/users/zentol/repos","events_url":"https://api.github.com/users/zentol/events{/privacy}","received_events_url":"https://api.github.com/users/zentol/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/zentol/flink","description":"Mirror of Apache Flink","fork":true,"url":"https://api.github.com/repos/zentol/flink","forks_url":"https://api.github.com/repos/zentol/flink/forks","keys_url":"https://api.github.com/repos/zentol/flink/keys{/key_id}","collaborators_url":"https://api.github.com/repos/zentol/flink/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/zentol/flink/teams","hooks_url":"https://api.github.com/repos/zentol/flink/hooks","issue_events_url":"https://api.github.com/repos/zentol/flink/issues/events{/number}","events_url":"https://api.github.com/repos/zentol/flink/events","assignees_url":"https://api.github.com/repos/zentol/flink/assignees{/user}","branches_url":"https://api.github.com/repos/zentol/flink/branches{/branch}","tags_url":"https://api.github.com/repos/zentol/flink/tags","blobs_url":"https://api.github.com/repos/zentol/flink/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/zentol/flink/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/zentol/flink/git/refs{/sha}","trees_url":"https://api.github.com/repos/zentol/flink/git/trees{/sha}","statuses_url":"https://api.github.com/repos/zentol/flink/statuses/{sha}","languages_url":"https://api.github.com/repos/zentol/flink/languages","stargazers_url":"https://api.github.com/repos/zentol/flink/stargazers","contributors_url":"https://api.github.com/repos/zentol/flink/contributors","subscribers_url":"https://api.github.com/repos/zentol/flink/subscribers","subscription_url":"https://api.github.com/repos/zentol/flink/subscription","commits_url":"https://api.github.com/repos/zentol/flink/commits{/sha}","git_commits_url":"https://api.github.com/repos/zentol/flink/git/commits{/sha}","comments_url":"https://api.github.com/repos/zentol/flink/comments{/number}","issue_comment_url":"https://api.github.com/repos/zentol/flink/issues/comments{/number}","contents_url":"https://api.github.com/repos/zentol/flink/contents/{+path}","compare_url":"https://api.github.com/repos/zentol/flink/compare/{base}...{head}","merges_url":"https://api.github.com/repos/zentol/flink/merges","archive_url":"https://api.github.com/repos/zentol/flink/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/zentol/flink/downloads","issues_url":"https://api.github.com/repos/zentol/flink/issues{/number}","pulls_url":"https://api.github.com/repos/zentol/flink/pulls{/number}","milestones_url":"https://api.github.com/repos/zentol/flink/milestones{/number}","notifications_url":"https://api.github.com/repos/zentol/flink/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/zentol/flink/labels{/name}","releases_url":"https://api.github.com/repos/zentol/flink/releases{/id}","deployments_url":"https://api.github.com/repos/zentol/flink/deployments","created_at":"2014-06-09T13:27:33Z","updated_at":"2016-01-19T13:55:47Z","pushed_at":"2016-09-23T11:57:01Z","git_url":"git://github.com/zentol/flink.git","ssh_url":"git@github.com:zentol/flink.git","clone_url":"https://github.com/zentol/flink.git","svn_url":"https://github.com/zentol/flink","homepage":null,"size":92674,"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":"apache:master","ref":"master","sha":"e92f91aeba3c9e8da5a5ff9efda342cb19da928c","user":{"login":"apache","id":47359,"avatar_url":"https://avatars.githubusercontent.com/u/47359?v=3","gravatar_id":"","url":"https://api.github.com/users/apache","html_url":"https://github.com/apache","followers_url":"https://api.github.com/users/apache/followers","following_url":"https://api.github.com/users/apache/following{/other_user}","gists_url":"https://api.github.com/users/apache/gists{/gist_id}","starred_url":"https://api.github.com/users/apache/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apache/subscriptions","organizations_url":"https://api.github.com/users/apache/orgs","repos_url":"https://api.github.com/users/apache/repos","events_url":"https://api.github.com/users/apache/events{/privacy}","received_events_url":"https://api.github.com/users/apache/received_events","type":"Organization","site_admin":false},"repo":{"id":20587599,"name":"flink","full_name":"apache/flink","owner":{"login":"apache","id":47359,"avatar_url":"https://avatars.githubusercontent.com/u/47359?v=3","gravatar_id":"","url":"https://api.github.com/users/apache","html_url":"https://github.com/apache","followers_url":"https://api.github.com/users/apache/followers","following_url":"https://api.github.com/users/apache/following{/other_user}","gists_url":"https://api.github.com/users/apache/gists{/gist_id}","starred_url":"https://api.github.com/users/apache/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apache/subscriptions","organizations_url":"https://api.github.com/users/apache/orgs","repos_url":"https://api.github.com/users/apache/repos","events_url":"https://api.github.com/users/apache/events{/privacy}","received_events_url":"https://api.github.com/users/apache/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/apache/flink","description":"Mirror of Apache Flink","fork":false,"url":"https://api.github.com/repos/apache/flink","forks_url":"https://api.github.com/repos/apache/flink/forks","keys_url":"https://api.github.com/repos/apache/flink/keys{/key_id}","collaborators_url":"https://api.github.com/repos/apache/flink/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/apache/flink/teams","hooks_url":"https://api.github.com/repos/apache/flink/hooks","issue_events_url":"https://api.github.com/repos/apache/flink/issues/events{/number}","events_url":"https://api.github.com/repos/apache/flink/events","assignees_url":"https://api.github.com/repos/apache/flink/assignees{/user}","branches_url":"https://api.github.com/repos/apache/flink/branches{/branch}","tags_url":"https://api.github.com/repos/apache/flink/tags","blobs_url":"https://api.github.com/repos/apache/flink/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/apache/flink/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/apache/flink/git/refs{/sha}","trees_url":"https://api.github.com/repos/apache/flink/git/trees{/sha}","statuses_url":"https://api.github.com/repos/apache/flink/statuses/{sha}","languages_url":"https://api.github.com/repos/apache/flink/languages","stargazers_url":"https://api.github.com/repos/apache/flink/stargazers","contributors_url":"https://api.github.com/repos/apache/flink/contributors","subscribers_url":"https://api.github.com/repos/apache/flink/subscribers","subscription_url":"https://api.github.com/repos/apache/flink/subscription","commits_url":"https://api.github.com/repos/apache/flink/commits{/sha}","git_commits_url":"https://api.github.com/repos/apache/flink/git/commits{/sha}","comments_url":"https://api.github.com/repos/apache/flink/comments{/number}","issue_comment_url":"https://api.github.com/repos/apache/flink/issues/comments{/number}","contents_url":"https://api.github.com/repos/apache/flink/contents/{+path}","compare_url":"https://api.github.com/repos/apache/flink/compare/{base}...{head}","merges_url":"https://api.github.com/repos/apache/flink/merges","archive_url":"https://api.github.com/repos/apache/flink/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/apache/flink/downloads","issues_url":"https://api.github.com/repos/apache/flink/issues{/number}","pulls_url":"https://api.github.com/repos/apache/flink/pulls{/number}","milestones_url":"https://api.github.com/repos/apache/flink/milestones{/number}","notifications_url":"https://api.github.com/repos/apache/flink/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/apache/flink/labels{/name}","releases_url":"https://api.github.com/repos/apache/flink/releases{/id}","deployments_url":"https://api.github.com/repos/apache/flink/deployments","created_at":"2014-06-07T07:00:10Z","updated_at":"2016-09-23T04:23:34Z","pushed_at":"2016-09-23T12:16:52Z","git_url":"git://github.com/apache/flink.git","ssh_url":"git@github.com:apache/flink.git","clone_url":"https://github.com/apache/flink.git","svn_url":"https://github.com/apache/flink","homepage":null,"size":126663,"stargazers_count":1595,"watchers_count":1595,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1070,"mirror_url":"git://git.apache.org/flink.git","open_issues_count":150,"forks":1070,"open_issues":150,"watchers":1595,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/apache/flink/pulls/2484"},"html":{"href":"https://github.com/apache/flink/pull/2484"},"issue":{"href":"https://api.github.com/repos/apache/flink/issues/2484"},"comments":{"href":"https://api.github.com/repos/apache/flink/issues/2484/comments"},"review_comments":{"href":"https://api.github.com/repos/apache/flink/pulls/2484/comments"},"review_comment":{"href":"https://api.github.com/repos/apache/flink/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/apache/flink/pulls/2484/commits"},"statuses":{"href":"https://api.github.com/repos/apache/flink/statuses/fbf99d660b832f9f0969185ebf84026d5406251f"}}}}
{"actor":{"display_login":"zentol"}}