From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS4713 221.184.0.0/13 X-Spam-Status: No, score=-3.3 required=3.0 tests=AWL,BAYES_00, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from neon.ruby-lang.org (neon.ruby-lang.org [221.186.184.75]) by dcvr.yhbt.net (Postfix) with ESMTP id EA8AD1F453 for ; Mon, 21 Jan 2019 08:34:00 +0000 (UTC) Received: from neon.ruby-lang.org (localhost [IPv6:::1]) by neon.ruby-lang.org (Postfix) with ESMTP id E64221214C2; Mon, 21 Jan 2019 17:33:57 +0900 (JST) Received: from o1678916x28.outbound-mail.sendgrid.net (o1678916x28.outbound-mail.sendgrid.net [167.89.16.28]) by neon.ruby-lang.org (Postfix) with ESMTPS id 9474612126E for ; Mon, 21 Jan 2019 17:33:56 +0900 (JST) Received: by filter0026p3iad2.sendgrid.net with SMTP id filter0026p3iad2-7628-5C4583F1-3B 2019-01-21 08:33:53.89131043 +0000 UTC m=+559696.951064659 Received: from herokuapp.com (ec2-54-205-253-189.compute-1.amazonaws.com [54.205.253.189]) by ismtpd0002p1iad1.sendgrid.net (SG) with ESMTP id LbTxKwxFQ7ya0WTenCGv3Q for ; Mon, 21 Jan 2019 08:33:53.630 +0000 (UTC) Date: Mon, 21 Jan 2019 08:33:54 +0000 (UTC) From: mame@ruby-lang.org To: ruby-core@ruby-lang.org Message-ID: References: Mime-Version: 1.0 X-Redmine-MailingListIntegration-Message-Ids: 66653 X-Redmine-Project: ruby-trunk X-Redmine-Issue-Id: 12480 X-Redmine-Issue-Author: grosser X-Redmine-Issue-Assignee: mame X-Redmine-Sender: mame X-Mailer: Redmine X-Redmine-Host: bugs.ruby-lang.org X-Redmine-Site: Ruby Issue Tracking System X-Auto-Response-Suppress: All Auto-Submitted: auto-generated X-SG-EID: ync6xU2WACa70kv/Ymy4QrNMhiuLXJG8OTL2vJD1yS7gSICQjaU3NctcgHeB95bC9UXupFvTtXIv9r R8nBu+VH6GpXfgwBq7VLI8RYnCXZzElAe+8tIuP0U4PsgFJUhd5L63O38gfgGqvxcwtu/hhO4GqVnE CbijoWlkaM82YUBcR9Lo4FbSXsVh7H9dA2dqkzsTGyF3qCQ+Kfm0bWWq2g== X-ML-Name: ruby-core X-Mail-Count: 91205 Subject: [ruby-core:91205] [Ruby trunk Bug#12480] Restarting Coverage does not capture additional coverage for already loaded files X-BeenThere: ruby-core@ruby-lang.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: Ruby developers List-Id: Ruby developers List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ruby-core-bounces@ruby-lang.org Sender: "ruby-core" Issue #12480 has been updated by mame (Yusuke Endoh). Status changed from Feedback to Closed Closing due to OP's request. FYI: Since 2.6, coverage.so has supported `Coverage.result(stop: false, clear: false)`. You may want to check it out. ---------------------------------------- Bug #12480: Restarting Coverage does not capture additional coverage for already loaded files https://bugs.ruby-lang.org/issues/12480#change-76442 * Author: grosser (Michael Grosser) * Status: Closed * Priority: Normal * Assignee: mame (Yusuke Endoh) * Target version: * ruby -v: 2.3.1 * Backport: 2.1: UNKNOWN, 2.2: UNKNOWN, 2.3: UNKNOWN ---------------------------------------- I'm trying to combine coverage from before fork and after fork to make coverage reporting work in a forking test runner. The problem I ran into is 2-fold: - A: when forking, previous coverage is lost - B: when restarting coverage, old files do not get added to I could work around issue A by storing the old result and then merging it with the new result post fork, but issue B makes that impossible. Please fix either A or B ... Reproduction steps for A: ~~~ # reproduce.rb require 'coverage' Coverage.start require_relative 'test' a fork do b new = Coverage.result puts "NEW: #{new}" end # test.rb def a 1 end def b 1 end ~~~ NEW: {"/Users/mgrosser/Code/tools/forking_test_runner/test.rb"=>[0, 0, nil, nil, 0, 1, nil]} -> missing coverage information for method `a` Reproduction steps for B: ~~~ # reproduce.rb require 'coverage' Coverage.start require_relative 'test' a old = Coverage.result Coverage.start b new = Coverage.result puts "OLD: #{old} -- NEW: #{new}" # test.rb def a 1 end def b 1 end ~~~ OLD: {"test.rb"=>[1, 1, nil, nil, 1, 0, nil]} -- NEW: {"test.rb"=>[]} -> missing coverage information for method `b` -- https://bugs.ruby-lang.org/