{"action":"created","comment":{"url":"https://api.github.com/repos/ceph/ceph/pulls/comments/57352229","id":57352229,"diff_hunk":"@@ -114,15 +122,86 @@ for arversion in `ls -v $dir/archive`; do\n           failed=$(($failed + 1))\n         fi\n         numtests=$(($numtests + 1))\n+        echo \"failed=$failed\" > $output_file\n+        echo \"numtests=$numtests\" >> $output_file\n       done\n     else\n       echo \"skipping unrecognized type $type\"\n     fi\n+\n+    rm -f $tmp1 $tmp2\n+}\n+\n+waitall() { # PID...\n+   ## Wait for children to exit and indicate whether all exited with 0 status.\n+   local errors=0\n+   while :; do\n+     debug \"Processes remaining: $*\"\n+     for pid in \"$@\"; do\n+       shift\n+       if kill -0 \"$pid\" 2>/dev/null; then\n+         debug \"$pid is still alive.\"\n+         set -- \"$@\" \"$pid\"\n+       elif wait \"$pid\"; then\n+         debug \"$pid exited with zero exit status.\"\n+       else\n+         debug \"$pid exited with non-zero exit status.\"\n+         errors=$(($errors + 1))\n+       fi\n+     done\n+     ((\"$#\" > 0)) || break\n+     sleep ${WAITALL_DELAY:-1}\n+    done\n+   [ $errors -eq 0 ]\n+}\n+\n+######\n+# MAIN\n+######\n+\n+# Using $MAX_PARALLEL_JOBS jobs if defined, unless the number of logical\n+# processors\n+max_parallel_jobs=${MAX_PARALLEL_JOBS:-$(nproc)}\n+\n+for arversion in `ls -v $dir/archive`; do\n+  vdir=\"$dir/archive/$arversion\"\n+  #echo $vdir\n+\n+  if [ ! -d \"$vdir/objects\" ]; then\n+    continue;\n+  fi\n+\n+  output_file=`mktemp /tmp/typ-XXXXXXXXX`\n+  running_jobs=0\n+  for type in `ls $vdir/objects`; do\n+    test_object $type $output_file.$running_jobs &\n+    pids=\"$pids $!\"\n+    running_jobs=$(($running_jobs + 1))\n+\n+    # Once we spawned enough jobs, let's wait them to complete\n+    # Every spawned job have almost the same execution time so\n+    # it's not a big deal having them not ending at the same time\n+    if [ \"$running_jobs\" -eq \"$max_parallel_jobs\" ]; then\n+        waitall $pids\n+        pids=\"\"\n+        # Reading the output of jobs to compute failed & numtests\n+        # Tests are run in parallel but sum should be done sequentialy to avoid\n+        # races between threads\n+        while [ \"$running_jobs\" -ge 0 ]; do\n+            if [ -f $output_file.$running_jobs ]; then\n+                read_failed=$(grep \"^failed=\" $output_file.$running_jobs | cut -d \"=\" -f 2)\n+                read_numtests=$(grep \"^numtests=\" $output_file.$running_jobs | cut -d \"=\" -f 2)\n+                rm -f $output_file.$running_jobs\n+                failed=$(($failed + $read_failed))\n+                numtests=$(($numtests + $read_numtests))\n+            fi\n+            running_jobs=$(($running_jobs - 1))\n+        done\n+        running_jobs=0\n+    fi\n   done\n done\n \n-rm -f $tmp1 $tmp2\n-\n if [ $failed -gt 0 ]; then","path":"src/test/encoding/readable.sh","position":146,"original_position":146,"commit_id":"d63bc0c58501d6ff5fb641abf53c416c38d13e56","original_commit_id":"87e115ca7ff050df8ed81b8a98cedcd8bd11121d","user":{"login":"ErwanAliasr1","id":4539421,"avatar_url":"https://avatars.githubusercontent.com/u/4539421?v=3","gravatar_id":"","url":"https://api.github.com/users/ErwanAliasr1","html_url":"https://github.com/ErwanAliasr1","followers_url":"https://api.github.com/users/ErwanAliasr1/followers","following_url":"https://api.github.com/users/ErwanAliasr1/following{/other_user}","gists_url":"https://api.github.com/users/ErwanAliasr1/gists{/gist_id}","starred_url":"https://api.github.com/users/ErwanAliasr1/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ErwanAliasr1/subscriptions","organizations_url":"https://api.github.com/users/ErwanAliasr1/orgs","repos_url":"https://api.github.com/users/ErwanAliasr1/repos","events_url":"https://api.github.com/users/ErwanAliasr1/events{/privacy}","received_events_url":"https://api.github.com/users/ErwanAliasr1/received_events","type":"User","site_admin":false},"body":"The main goal was a performance gain. But would be nice to get more review on it yes.","created_at":"2016-03-24T17:15:08Z","updated_at":"2016-03-24T17:15:08Z","html_url":"https://github.com/ceph/ceph/pull/8131#discussion_r57352229","pull_request_url":"https://api.github.com/repos/ceph/ceph/pulls/8131","_links":{"self":{"href":"https://api.github.com/repos/ceph/ceph/pulls/comments/57352229"},"html":{"href":"https://github.com/ceph/ceph/pull/8131#discussion_r57352229"},"pull_request":{"href":"https://api.github.com/repos/ceph/ceph/pulls/8131"}}},"pull_request":{"url":"https://api.github.com/repos/ceph/ceph/pulls/8131","id":62933015,"html_url":"https://github.com/ceph/ceph/pull/8131","diff_url":"https://github.com/ceph/ceph/pull/8131.diff","patch_url":"https://github.com/ceph/ceph/pull/8131.patch","issue_url":"https://api.github.com/repos/ceph/ceph/issues/8131","number":8131,"state":"open","locked":false,"title":"tests: Improving 'make check' execution time","user":{"login":"ErwanAliasr1","id":4539421,"avatar_url":"https://avatars.githubusercontent.com/u/4539421?v=3","gravatar_id":"","url":"https://api.github.com/users/ErwanAliasr1","html_url":"https://github.com/ErwanAliasr1","followers_url":"https://api.github.com/users/ErwanAliasr1/followers","following_url":"https://api.github.com/users/ErwanAliasr1/following{/other_user}","gists_url":"https://api.github.com/users/ErwanAliasr1/gists{/gist_id}","starred_url":"https://api.github.com/users/ErwanAliasr1/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ErwanAliasr1/subscriptions","organizations_url":"https://api.github.com/users/ErwanAliasr1/orgs","repos_url":"https://api.github.com/users/ErwanAliasr1/repos","events_url":"https://api.github.com/users/ErwanAliasr1/events{/privacy}","received_events_url":"https://api.github.com/users/ErwanAliasr1/received_events","type":"User","site_admin":false},"body":"When running make -j x check, we face a weird situation where the makefile\r\ntargets are spawn in parallel up to \"x\" but some targets is very very\r\nlong and sequential.\r\n\r\nThis pull request aims at removing this bottlenecks to make a faster build process.\r\n\r\nThe initial running time was 30mn on a recent laptop and dropped to 14mn.\r\n\r\nSigned-off-by: Erwan Velu <erwan@redhat.com>","created_at":"2016-03-15T16:15:12Z","updated_at":"2016-03-24T17:15:08Z","closed_at":null,"merged_at":null,"merge_commit_sha":"07c3762a73461f90a06ae1de57ba43764820c001","assignee":{"login":"dachary","id":433594,"avatar_url":"https://avatars.githubusercontent.com/u/433594?v=3","gravatar_id":"","url":"https://api.github.com/users/dachary","html_url":"https://github.com/dachary","followers_url":"https://api.github.com/users/dachary/followers","following_url":"https://api.github.com/users/dachary/following{/other_user}","gists_url":"https://api.github.com/users/dachary/gists{/gist_id}","starred_url":"https://api.github.com/users/dachary/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dachary/subscriptions","organizations_url":"https://api.github.com/users/dachary/orgs","repos_url":"https://api.github.com/users/dachary/repos","events_url":"https://api.github.com/users/dachary/events{/privacy}","received_events_url":"https://api.github.com/users/dachary/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/ceph/ceph/pulls/8131/commits","review_comments_url":"https://api.github.com/repos/ceph/ceph/pulls/8131/comments","review_comment_url":"https://api.github.com/repos/ceph/ceph/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ceph/ceph/issues/8131/comments","statuses_url":"https://api.github.com/repos/ceph/ceph/statuses/d63bc0c58501d6ff5fb641abf53c416c38d13e56","head":{"label":"ErwanAliasr1:evelu-fast-check","ref":"evelu-fast-check","sha":"d63bc0c58501d6ff5fb641abf53c416c38d13e56","user":{"login":"ErwanAliasr1","id":4539421,"avatar_url":"https://avatars.githubusercontent.com/u/4539421?v=3","gravatar_id":"","url":"https://api.github.com/users/ErwanAliasr1","html_url":"https://github.com/ErwanAliasr1","followers_url":"https://api.github.com/users/ErwanAliasr1/followers","following_url":"https://api.github.com/users/ErwanAliasr1/following{/other_user}","gists_url":"https://api.github.com/users/ErwanAliasr1/gists{/gist_id}","starred_url":"https://api.github.com/users/ErwanAliasr1/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ErwanAliasr1/subscriptions","organizations_url":"https://api.github.com/users/ErwanAliasr1/orgs","repos_url":"https://api.github.com/users/ErwanAliasr1/repos","events_url":"https://api.github.com/users/ErwanAliasr1/events{/privacy}","received_events_url":"https://api.github.com/users/ErwanAliasr1/received_events","type":"User","site_admin":false},"repo":{"id":49494134,"name":"ceph","full_name":"ErwanAliasr1/ceph","owner":{"login":"ErwanAliasr1","id":4539421,"avatar_url":"https://avatars.githubusercontent.com/u/4539421?v=3","gravatar_id":"","url":"https://api.github.com/users/ErwanAliasr1","html_url":"https://github.com/ErwanAliasr1","followers_url":"https://api.github.com/users/ErwanAliasr1/followers","following_url":"https://api.github.com/users/ErwanAliasr1/following{/other_user}","gists_url":"https://api.github.com/users/ErwanAliasr1/gists{/gist_id}","starred_url":"https://api.github.com/users/ErwanAliasr1/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ErwanAliasr1/subscriptions","organizations_url":"https://api.github.com/users/ErwanAliasr1/orgs","repos_url":"https://api.github.com/users/ErwanAliasr1/repos","events_url":"https://api.github.com/users/ErwanAliasr1/events{/privacy}","received_events_url":"https://api.github.com/users/ErwanAliasr1/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ErwanAliasr1/ceph","description":"Ceph is a distributed object, block, and file storage platform ","fork":true,"url":"https://api.github.com/repos/ErwanAliasr1/ceph","forks_url":"https://api.github.com/repos/ErwanAliasr1/ceph/forks","keys_url":"https://api.github.com/repos/ErwanAliasr1/ceph/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ErwanAliasr1/ceph/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ErwanAliasr1/ceph/teams","hooks_url":"https://api.github.com/repos/ErwanAliasr1/ceph/hooks","issue_events_url":"https://api.github.com/repos/ErwanAliasr1/ceph/issues/events{/number}","events_url":"https://api.github.com/repos/ErwanAliasr1/ceph/events","assignees_url":"https://api.github.com/repos/ErwanAliasr1/ceph/assignees{/user}","branches_url":"https://api.github.com/repos/ErwanAliasr1/ceph/branches{/branch}","tags_url":"https://api.github.com/repos/ErwanAliasr1/ceph/tags","blobs_url":"https://api.github.com/repos/ErwanAliasr1/ceph/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ErwanAliasr1/ceph/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ErwanAliasr1/ceph/git/refs{/sha}","trees_url":"https://api.github.com/repos/ErwanAliasr1/ceph/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ErwanAliasr1/ceph/statuses/{sha}","languages_url":"https://api.github.com/repos/ErwanAliasr1/ceph/languages","stargazers_url":"https://api.github.com/repos/ErwanAliasr1/ceph/stargazers","contributors_url":"https://api.github.com/repos/ErwanAliasr1/ceph/contributors","subscribers_url":"https://api.github.com/repos/ErwanAliasr1/ceph/subscribers","subscription_url":"https://api.github.com/repos/ErwanAliasr1/ceph/subscription","commits_url":"https://api.github.com/repos/ErwanAliasr1/ceph/commits{/sha}","git_commits_url":"https://api.github.com/repos/ErwanAliasr1/ceph/git/commits{/sha}","comments_url":"https://api.github.com/repos/ErwanAliasr1/ceph/comments{/number}","issue_comment_url":"https://api.github.com/repos/ErwanAliasr1/ceph/issues/comments{/number}","contents_url":"https://api.github.com/repos/ErwanAliasr1/ceph/contents/{+path}","compare_url":"https://api.github.com/repos/ErwanAliasr1/ceph/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ErwanAliasr1/ceph/merges","archive_url":"https://api.github.com/repos/ErwanAliasr1/ceph/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ErwanAliasr1/ceph/downloads","issues_url":"https://api.github.com/repos/ErwanAliasr1/ceph/issues{/number}","pulls_url":"https://api.github.com/repos/ErwanAliasr1/ceph/pulls{/number}","milestones_url":"https://api.github.com/repos/ErwanAliasr1/ceph/milestones{/number}","notifications_url":"https://api.github.com/repos/ErwanAliasr1/ceph/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ErwanAliasr1/ceph/labels{/name}","releases_url":"https://api.github.com/repos/ErwanAliasr1/ceph/releases{/id}","deployments_url":"https://api.github.com/repos/ErwanAliasr1/ceph/deployments","created_at":"2016-01-12T10:56:15Z","updated_at":"2016-01-12T10:56:33Z","pushed_at":"2016-03-24T17:07:39Z","git_url":"git://github.com/ErwanAliasr1/ceph.git","ssh_url":"git@github.com:ErwanAliasr1/ceph.git","clone_url":"https://github.com/ErwanAliasr1/ceph.git","svn_url":"https://github.com/ErwanAliasr1/ceph","homepage":"http://ceph.com","size":165930,"stargazers_count":0,"watchers_count":0,"language":"C++","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":"ceph:master","ref":"master","sha":"a2efc127ba779b4605b33284f62a038e42a8e101","user":{"login":"ceph","id":1015767,"avatar_url":"https://avatars.githubusercontent.com/u/1015767?v=3","gravatar_id":"","url":"https://api.github.com/users/ceph","html_url":"https://github.com/ceph","followers_url":"https://api.github.com/users/ceph/followers","following_url":"https://api.github.com/users/ceph/following{/other_user}","gists_url":"https://api.github.com/users/ceph/gists{/gist_id}","starred_url":"https://api.github.com/users/ceph/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ceph/subscriptions","organizations_url":"https://api.github.com/users/ceph/orgs","repos_url":"https://api.github.com/users/ceph/repos","events_url":"https://api.github.com/users/ceph/events{/privacy}","received_events_url":"https://api.github.com/users/ceph/received_events","type":"Organization","site_admin":false},"repo":{"id":2310495,"name":"ceph","full_name":"ceph/ceph","owner":{"login":"ceph","id":1015767,"avatar_url":"https://avatars.githubusercontent.com/u/1015767?v=3","gravatar_id":"","url":"https://api.github.com/users/ceph","html_url":"https://github.com/ceph","followers_url":"https://api.github.com/users/ceph/followers","following_url":"https://api.github.com/users/ceph/following{/other_user}","gists_url":"https://api.github.com/users/ceph/gists{/gist_id}","starred_url":"https://api.github.com/users/ceph/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ceph/subscriptions","organizations_url":"https://api.github.com/users/ceph/orgs","repos_url":"https://api.github.com/users/ceph/repos","events_url":"https://api.github.com/users/ceph/events{/privacy}","received_events_url":"https://api.github.com/users/ceph/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ceph/ceph","description":"Ceph is a distributed object, block, and file storage platform ","fork":false,"url":"https://api.github.com/repos/ceph/ceph","forks_url":"https://api.github.com/repos/ceph/ceph/forks","keys_url":"https://api.github.com/repos/ceph/ceph/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ceph/ceph/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ceph/ceph/teams","hooks_url":"https://api.github.com/repos/ceph/ceph/hooks","issue_events_url":"https://api.github.com/repos/ceph/ceph/issues/events{/number}","events_url":"https://api.github.com/repos/ceph/ceph/events","assignees_url":"https://api.github.com/repos/ceph/ceph/assignees{/user}","branches_url":"https://api.github.com/repos/ceph/ceph/branches{/branch}","tags_url":"https://api.github.com/repos/ceph/ceph/tags","blobs_url":"https://api.github.com/repos/ceph/ceph/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ceph/ceph/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ceph/ceph/git/refs{/sha}","trees_url":"https://api.github.com/repos/ceph/ceph/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ceph/ceph/statuses/{sha}","languages_url":"https://api.github.com/repos/ceph/ceph/languages","stargazers_url":"https://api.github.com/repos/ceph/ceph/stargazers","contributors_url":"https://api.github.com/repos/ceph/ceph/contributors","subscribers_url":"https://api.github.com/repos/ceph/ceph/subscribers","subscription_url":"https://api.github.com/repos/ceph/ceph/subscription","commits_url":"https://api.github.com/repos/ceph/ceph/commits{/sha}","git_commits_url":"https://api.github.com/repos/ceph/ceph/git/commits{/sha}","comments_url":"https://api.github.com/repos/ceph/ceph/comments{/number}","issue_comment_url":"https://api.github.com/repos/ceph/ceph/issues/comments{/number}","contents_url":"https://api.github.com/repos/ceph/ceph/contents/{+path}","compare_url":"https://api.github.com/repos/ceph/ceph/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ceph/ceph/merges","archive_url":"https://api.github.com/repos/ceph/ceph/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ceph/ceph/downloads","issues_url":"https://api.github.com/repos/ceph/ceph/issues{/number}","pulls_url":"https://api.github.com/repos/ceph/ceph/pulls{/number}","milestones_url":"https://api.github.com/repos/ceph/ceph/milestones{/number}","notifications_url":"https://api.github.com/repos/ceph/ceph/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ceph/ceph/labels{/name}","releases_url":"https://api.github.com/repos/ceph/ceph/releases{/id}","deployments_url":"https://api.github.com/repos/ceph/ceph/deployments","created_at":"2011-09-01T21:41:26Z","updated_at":"2016-03-24T13:57:26Z","pushed_at":"2016-03-24T17:07:40Z","git_url":"git://github.com/ceph/ceph.git","ssh_url":"git@github.com:ceph/ceph.git","clone_url":"https://github.com/ceph/ceph.git","svn_url":"https://github.com/ceph/ceph","homepage":"http://ceph.com","size":209023,"stargazers_count":1982,"watchers_count":1982,"language":"C++","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1205,"mirror_url":null,"open_issues_count":289,"forks":1205,"open_issues":289,"watchers":1982,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ceph/ceph/pulls/8131"},"html":{"href":"https://github.com/ceph/ceph/pull/8131"},"issue":{"href":"https://api.github.com/repos/ceph/ceph/issues/8131"},"comments":{"href":"https://api.github.com/repos/ceph/ceph/issues/8131/comments"},"review_comments":{"href":"https://api.github.com/repos/ceph/ceph/pulls/8131/comments"},"review_comment":{"href":"https://api.github.com/repos/ceph/ceph/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ceph/ceph/pulls/8131/commits"},"statuses":{"href":"https://api.github.com/repos/ceph/ceph/statuses/d63bc0c58501d6ff5fb641abf53c416c38d13e56"}}}}