From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Robert Pluim Newsgroups: gmane.emacs.bugs Subject: bug#46641: process-tests assume network connection Date: Sun, 21 Feb 2021 17:45:29 +0100 Message-ID: <87blcdgyja.fsf@gmail.com> References: <4lpn0wndla.fsf@fencepost.gnu.org> <871rd9smip.fsf@gmail.com> <87k0r1k07c.fsf@gnus.org> <87pn0tqtq7.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="21548"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Glenn Morris , 46641@debbugs.gnu.org To: Lars Ingebrigtsen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Feb 21 17:46:13 2021 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 1lDrs5-0005U6-6v for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 21 Feb 2021 17:46:13 +0100 Original-Received: from localhost ([::1]:44554 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lDrs4-0004FC-4A for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 21 Feb 2021 11:46:12 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:55970) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lDrru-0004Du-Qq for bug-gnu-emacs@gnu.org; Sun, 21 Feb 2021 11:46:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:43139) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lDrru-0003GG-I1 for bug-gnu-emacs@gnu.org; Sun, 21 Feb 2021 11:46:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lDrru-0000KM-Gf for bug-gnu-emacs@gnu.org; Sun, 21 Feb 2021 11:46:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Robert Pluim Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 21 Feb 2021 16:46:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 46641 X-GNU-PR-Package: emacs Original-Received: via spool by 46641-submit@debbugs.gnu.org id=B46641.16139259461219 (code B ref 46641); Sun, 21 Feb 2021 16:46:02 +0000 Original-Received: (at 46641) by debbugs.gnu.org; 21 Feb 2021 16:45:46 +0000 Original-Received: from localhost ([127.0.0.1]:54679 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lDrre-0000Jb-0S for submit@debbugs.gnu.org; Sun, 21 Feb 2021 11:45:46 -0500 Original-Received: from mail-wr1-f43.google.com ([209.85.221.43]:33502) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lDrra-0000JL-OY for 46641@debbugs.gnu.org; Sun, 21 Feb 2021 11:45:44 -0500 Original-Received: by mail-wr1-f43.google.com with SMTP id 7so16607849wrz.0 for <46641@debbugs.gnu.org>; Sun, 21 Feb 2021 08:45:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :mime-version; bh=CGEkmY4Fsu6F94GbvfCo71/gUBTo5MHWMU18RGt1tiA=; b=EB4VKrfB8rMQKK46X/Uaodd/Zq7KHLXEWOx0IAxSxuVC1Z9u9o2snU3Z9bBcfmURKw qvXTV59xxad/Zj31//S6p0p8brmSh1llbwpPyJ5lXEanplW5RpAIBXKlNcHSUxNobbPi ERa0/wtRak0eWe6ywpg9Vy4i6zQzuEErNrW3i8dQEOYK2bUCv5F41R69RqXI1JcFd7Cp TNrXoA0piTJxIy539qDRsWF9fgFfsT3104e0Rpkmo6zErh2Nv5qK3Nj9hyKw6CRcy6DU NsQVdpblpES5tqd/IyairuI7f88+zA+5yzxJM3nYmiWAnEd8rPIt7W3oD7cMM8cuAiah /Iew== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:mime-version; bh=CGEkmY4Fsu6F94GbvfCo71/gUBTo5MHWMU18RGt1tiA=; b=lJOVXEMR9x/56V4U7M/TTmBObmiwKBESuAFg9YROxaUqkX44yLAwpmLEK0lGMeKos+ W7sLF8HWTj9ba8YBC80hSheC3ywWGHPS9vD7GsZt3tuL1/tVqAToQzHKbW9Vh+AqQhzZ qflPQhR2dLbLFayRWgh8+Gxk7Zw9Z3U8qsTfy0ANVcP1gf5KyQjZ/DfnyZBy6+qJVMLb ZTyc37Yp3eMErbrRxgLWoxgsiD0n0hBWZryido46MLZfAM0twq2eIyyAh/9HLibVbL59 Ln22K96oMQBvsiNTK9QaUWAfVVmPz+YKbcC4lLzD8+RhiG/yGs4BHlrTepteGiNaMNeL oXYw== X-Gm-Message-State: AOAM532RCHwdryDsap/pd91nhMbRL9zUXrE+f5tAy03b8/iaodkMm7JB 7I3zvihwGFG3Z8jQzXFIJhsf0Wwn9igBVA== X-Google-Smtp-Source: ABdhPJx+/k+GCGcj0l/FJDSMS25sTVjj9Rq0nZIorrus1YMTQPw5oYTtrIfzfG0Yzd0VIl5qSkQ9aw== X-Received: by 2002:a5d:6a4f:: with SMTP id t15mr1172259wrw.219.1613925936456; Sun, 21 Feb 2021 08:45:36 -0800 (PST) Original-Received: from rltb ([2a01:e0a:3f3:fb50:2154:6435:5293:4d19]) by smtp.gmail.com with ESMTPSA id h17sm17279064wrw.74.2021.02.21.08.45.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 21 Feb 2021 08:45:35 -0800 (PST) In-Reply-To: <87pn0tqtq7.fsf@gmail.com> (Robert Pluim's message of "Sun, 21 Feb 2021 17:19:12 +0100") 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" Xref: news.gmane.io gmane.emacs.bugs:200506 Archived-At: >>>>> On Sun, 21 Feb 2021 17:19:12 +0100, Robert Pluim said: Robert> Well, the tests in question are asking 'does emacs have a correctly Robert> functioning internet connection', so making that a prerequisite for Robert> the test seems kind of redundant, but we can do it. But first: Robert> disabling my network connection causes dns-query to hang, so something Robert> like this is needed, I think (we can skip the first hunk if you want): Ah, the wonders of running diff when you haven't tested the result from a clean emacs. This one actually works. diff --git a/lisp/net/dns.el b/lisp/net/dns.el index 2045d4dfca..3ae7469798 100644 --- a/lisp/net/dns.el +++ b/lisp/net/dns.el @@ -332,7 +332,7 @@ dns-set-servers (setq dns-servers (nreverse dns-servers)))) (when (executable-find "nslookup") (with-temp-buffer - (call-process "nslookup" nil t nil "localhost") + (call-process "nslookup" nil t nil "-retry=0" "-timeout=2" "localhost") (goto-char (point-min)) (when (re-search-forward "^Address:[ \t]*\\([0-9]+\\.[0-9]+\\.[0-9]+\\.[0-9]+\\|[[:xdigit:]:]*\\)" nil t) @@ -496,15 +496,17 @@ dns-query "Query a DNS server for NAME of TYPE. If FULL, return the entire record returned. If REVERSE, look up an IP address." - (let ((result nil)) - (dns-query-asynchronous - name - (lambda (response) - (setq result (list response))) - type full reverse) - ;; Loop until we get the callback. - (while (not result) - (sleep-for 0.01)) + (let* ((result nil) + (query-started + (dns-query-asynchronous + name + (lambda (response) + (setq result (list response))) + type full reverse))) + (if query-started + ;; Loop until we get the callback. + (while (not result) + (sleep-for 0.01))) (car result))) (provide 'dns)