From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Laurence Warne Newsgroups: gmane.emacs.bugs Subject: bug#63550: proced-refine-with-update-test is racy Date: Sun, 21 May 2023 19:45:16 +0100 Message-ID: References: <875y8rrxly.fsf@tcd.ie> <83pm6uq6c9.fsf@gnu.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="000000000000d99d0e05fc388e59" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="21420"; mail-complaints-to="usenet@ciao.gmane.io" Cc: contovob@tcd.ie, mattias.engdegard@gmail.com, 63550@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun May 21 20:46:20 2023 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1q0o4S-0005R2-8b for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 21 May 2023 20:46:20 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1q0o4D-00071e-Nv; Sun, 21 May 2023 14:46:07 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1q0o4A-00071L-Jy for bug-gnu-emacs@gnu.org; Sun, 21 May 2023 14:46:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1q0o4A-0005Uq-C9 for bug-gnu-emacs@gnu.org; Sun, 21 May 2023 14:46:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1q0o4A-0005NL-8E for bug-gnu-emacs@gnu.org; Sun, 21 May 2023 14:46:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Laurence Warne Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 21 May 2023 18:46:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 63550 X-GNU-PR-Package: emacs Original-Received: via spool by 63550-submit@debbugs.gnu.org id=B63550.168469473820628 (code B ref 63550); Sun, 21 May 2023 18:46:02 +0000 Original-Received: (at 63550) by debbugs.gnu.org; 21 May 2023 18:45:38 +0000 Original-Received: from localhost ([127.0.0.1]:32856 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q0o3l-0005Md-FF for submit@debbugs.gnu.org; Sun, 21 May 2023 14:45:37 -0400 Original-Received: from mail-ua1-f48.google.com ([209.85.222.48]:58827) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q0o3j-0005MQ-5U for 63550@debbugs.gnu.org; Sun, 21 May 2023 14:45:35 -0400 Original-Received: by mail-ua1-f48.google.com with SMTP id a1e0cc1a2514c-783f1443b70so1726141241.1 for <63550@debbugs.gnu.org>; Sun, 21 May 2023 11:45:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1684694729; x=1687286729; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=iyxd4Tixzjp3a4Sb+hzd1VZB4TEkFV4HZjjCUBVb1V4=; b=hC36bRVr2eaStVq7iE9ZLGiP9161PQt2Uc6QFrHBjgT5qeEeNHZuoMX5Uu/fSOJIK/ YrjOTTMxcriLow0R68KrTDHFOU9nSZLF9egQrTxFyG+UFS2G6s45baZmG90e6vl9jsGN 9NYcS0FsltQ3Ds/+WM4HHl8Uu3ttaREuJjKPOARCRwjqK5d4nku6B2OjGh4nQ68/jPki 5dJmbsJbRO767bHT4z6dcid0oBSVsxz4Wb4tmO5Y8Hf69hxfzhtXRkxl+s/OVbUzhsgD 9VIEHierM4dir85M5f3vyC2QaSvlYdXtv0upc5JDXMj0wa8Hv3LlbKq577+DTMwuwt9W gaAA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684694729; x=1687286729; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=iyxd4Tixzjp3a4Sb+hzd1VZB4TEkFV4HZjjCUBVb1V4=; b=ZxGK1ieW1PqQptND1rGSNJa+VH57LvHkfXsAXZ7up/U3ncqrXcb9j+1jGpA+sXHR+j VqcdE+z3kbVYpFxcOe7kFNyExH1QeA1Wcu0vCYUbjfpNx0v8kwN3pD93Hl3clLo20v0x okVb73f+lpHoqS8aWI/JiwcpRwIaw3Pj+dACOYn4vgFEA6fsUTvqzVFRKuFdezRqCBWX FOqPtDhb1dFi1j7f97lvfNQFqwj7epF7eqPrsKjfRJ5tPDgJTOKiIVXAJBZFYkM1aWsv 2rtKNowoFvjBLBaswpgBGQW3smiMttkeDl7J+VyjNjeGHX7KJOf48TNv2goqznXijLXH duSg== X-Gm-Message-State: AC+VfDw309RBjBtwW+95Y7Z3mGiP4SQZKhwJEfBkZlWdvW8swXqx6ZBh zXmkgNpR2DORFc/XQSkj9INR1ukbQZL/25NVOc0= X-Google-Smtp-Source: ACHHUZ7YREggG24hQPurb7imSIV7+LXsZeYwdctHdcrAKjuKGKe6YM0dGtgXRVFYgOXHF2+/MDofut5QdE92K3TPnoo= X-Received: by 2002:a67:fb0c:0:b0:439:3275:88fb with SMTP id d12-20020a67fb0c000000b00439327588fbmr1834517vsr.12.1684694728534; Sun, 21 May 2023 11:45:28 -0700 (PDT) In-Reply-To: <83pm6uq6c9.fsf@gnu.org> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:262119 Archived-At: --000000000000d99d0e05fc388e59 Content-Type: multipart/alternative; boundary="000000000000d99d0b05fc388e57" --000000000000d99d0b05fc388e57 Content-Type: text/plain; charset="UTF-8" One thing I've noticed about the failing test is that we should probably use `(proced-update)` instead of `(proced-update t)` so as not to refresh `proced-process-alist` (I've attached a patch). When I first saw this, I thought this would fix the failure as I thought what might have been happening was that the process used for the refinement might have exited between proced being called, and then `(proced-update t)` being called, but I think the test should still pass in this case (though I've optimistically used 'fix' in the patch commit (: ). Mattias (or Basil), are you able to provide a backtrace? > Is mocking out the real Proced display a good idea in this case? > These tests test the ability to manipulate real-life process-attribute > displays, so showing they work in synthetic environment verifies only > part of the functionality, no? Since systems will likely have a variety of processes running at a time, I think you are right, mocking will result in less coverage, but then again the processes and their attributes people have running on their machines are not consistent. Perhaps we could use mocking, but only for features which are difficult to test otherwise, like refinements? Maybe I was too fast to jump to using mocking and it's tangential to this issue, though I'd still be interested to see if the (mocking patch) fixes the issue. --000000000000d99d0b05fc388e57 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
One thing I've noticed about the failing test is = that we should probably use `(proced-update)` instead of `(proced-update t)= ` so as not to refresh `proced-process-alist` (I've attached a patch).= =C2=A0 When I first saw this, I thought this would fix the failure as I tho= ught what might have been happening was that the process used for the refin= ement might have exited between proced being called, and then `(proced-upda= te t)` being called, but I think the test should still pass in this case (t= hough I've optimistically used 'fix' in the patch commit (: ).<= br>

Mattias (or Basil), are you able to provide a = backtrace?

> Is mocking out the real= Proced display a good idea in this case?
> These tests test the ability to manipulate real-life process-attribute=
> displays, so showing they work in synthetic environment verifies only<= br>
> part of the functionality, no?

Since systems = will likely have a variety of processes running at a time, I think you are = right, mocking will result in less coverage, but then again the processes a= nd their attributes people have running on their machines are not consisten= t.=C2=A0 Perhaps we could use mocking, but only for features which are diff= icult to test otherwise, like refinements?

May= be I was too fast to jump to using mocking and it's tangential to this = issue, though I'd still be interested to see if the (mocking patch) fix= es the issue.
--000000000000d99d0b05fc388e57-- --000000000000d99d0e05fc388e59 Content-Type: text/x-patch; charset="US-ASCII"; name="0001-Fix-unstable-proced-test.patch" Content-Disposition: attachment; filename="0001-Fix-unstable-proced-test.patch" Content-Transfer-Encoding: base64 Content-ID: X-Attachment-Id: f_lhxqsqiq0 RnJvbSA1OTc4MjczMTg3NmU2Mjg5OGVlM2VlMmE5MTJjOTM1YmY2YjIxMjU0IE1vbiBTZXAgMTcg MDA6MDA6MDAgMjAwMQpGcm9tOiBMYXVyZW5jZSBXYXJuZSA8bGF1cmVuY2V3YXJuZUBnbWFpbC5j b20+CkRhdGU6IFN1biwgMjEgTWF5IDIwMjMgMTg6NTk6NDMgKzAxMDAKU3ViamVjdDogW1BBVENI XSBGaXggdW5zdGFibGUgcHJvY2VkIHRlc3QKCkZpeCB1bnN0YWJsZSBwcm9jZWQgdGVzdCBieSBv bWl0dGluZyB0aGUgcmV2ZXJ0IHBhcmFtZXRlciBpbgoncHJvY2VkLXVwZGF0ZScuCgoqIHRlc3Qv bGlzcC9wcm9jZWQtdGVzdHMuZWwgKHByb2NlZC1yZWZpbmUtd2l0aC11cGRhdGUtdGVzdCk6IERv IG5vdAp1c2UgcmV2ZXJ0IHBhcmFtZXRlciB3aGVuIGNhbGxpbmcgJ3Byb2NlZC11cGRhdGUnLgot LS0KIHRlc3QvbGlzcC9wcm9jZWQtdGVzdHMuZWwgfCAzICstLQogMSBmaWxlIGNoYW5nZWQsID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