From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id wMZaN3RY82MrAgEAbAwnHQ (envelope-from ) for ; Mon, 20 Feb 2023 12:24:37 +0100 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id uAldNnRY82P5ywAAG6o9tA (envelope-from ) for ; Mon, 20 Feb 2023 12:24:36 +0100 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 95B321D3BD for ; Mon, 20 Feb 2023 12:24:36 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pU4HJ-0002iX-IF; Mon, 20 Feb 2023 06:24:17 -0500 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 1pU4HI-0002iC-Jv for emacs-orgmode@gnu.org; Mon, 20 Feb 2023 06:24:16 -0500 Received: from mout01.posteo.de ([185.67.36.65]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pU4HG-0000Dv-St for emacs-orgmode@gnu.org; Mon, 20 Feb 2023 06:24:16 -0500 Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id 54B8B2401A2 for ; Mon, 20 Feb 2023 12:24:13 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1676892253; bh=AoJPBE51rApKebxxRNUtG2G7XUkMNO2HvboUrEWHF3M=; h=From:To:Cc:Subject:Date:From; b=dTVX1QKMzsYYDhgx/DzndjsNqNaE3v5MPP99+ucYKqbez/9hx2INntS9wV9pW1ElD e0sx/ac4ecg1xMqzIR2gJTWFqBKcxN9jKQMCkfpvfdqH1pUjP/gRw4MMenvnydNHmo 2iyzWbFEEZBCl5f1iFAgKYJfmfEpfrLya4bAsrsD03SOnxnFfTKODYTbls2c1gfGQD cpBVI1uaXN6I9N7L+Gv9c4ZLYahldvC0yZPp41+yY/id3dOs7+niBGDkWeFSosue6k hairxEMLsCW8E3yRrChEB/NyVH4GXlPEoaMfTH9Ni1o1Z5EC34SExHl2Cph80D8+SH 0fbe+sovVD+Sw== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4PL0Rw3B8Gz6tnM; Mon, 20 Feb 2023 12:24:12 +0100 (CET) From: Ihor Radchenko To: Matt Cc: emacs-orgmode Subject: Re: [PATCH] Async evaluation in ob-shell In-Reply-To: <1866bf50874.bc4ef1a92164564.1238825567948423531@excalamus.com> References: <186283d230a.129f5feb61660123.3289004102603503414@excalamus.com> <87v8kd8zzw.fsf@localhost> <1863472efe9.10fdd5ba4258906.5972264927968042941@excalamus.com> <87y1p7axpe.fsf@localhost> <1863d69188f.11e078bd1228881.451172865246440158@excalamus.com> <87fsbcbf47.fsf@localhost> <186471d8980.c36aecd0374444.2548279362371712281@excalamus.com> <87sff73r0g.fsf@localhost> <18658639a30.dec640641420614.2364646537016397698@excalamus.com> <87lekwd10z.fsf@localhost> <1866bf50874.bc4ef1a92164564.1238825567948423531@excalamus.com> Date: Mon, 20 Feb 2023 11:24:52 +0000 Message-ID: <87r0ukefzv.fsf@localhost> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=185.67.36.65; envelope-from=yantar92@posteo.net; helo=mout01.posteo.de X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: emacs-orgmode-bounces+larch=yhetil.org@gnu.org X-Migadu-Country: US X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1676892276; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=k5pST6OqyRh6yiUbqI+vF8vODwE288RnJoY/ahmcx78=; b=SCMaLrfsGLT0poxoaL/PKADVbH99eoXfOIuJTWjEzsB/j4Xl0qoeO0oosxRCB6Fcsqe2iR Spd+lV0/8mm5Isc+IAAxy7tnWje75ZyC8Q9rVGNzMEML39ZOuaka+Mpd7QC4qxJorZFtwE YBJpmRbWxob3ZyHF9VUVYna7nwAozJg3PVg9cJYgS5ggRyyJ6xRQjNng/aJNnKZJ36Qz00 fbR/RaJIwQZRsDh17i7mhLyQb99Ak+tFrOBu8DcMqlQKLVI8rhgpD6DUy1JWJkJ3QkkNKZ F8e1nI90Q6hQtNFIjBUPJCrwL/sl5iEJo734aWAI+a/jEIJfyhYHH8rwgcr1kA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=dTVX1QKM; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org"; dmarc=pass (policy=none) header.from=posteo.net ARC-Seal: i=1; s=key1; d=yhetil.org; t=1676892276; a=rsa-sha256; cv=none; b=QwAQb5i2NHpHoBvxvv9agLfc4Ot3QlPf58b50wi1a8YlJ3GDZuuV7UdSK/b9qAb3OY6jkg 3d+xF0I2I3a9YP2KFW+lL3ZhsdW1aN34+iL9MzHHoawQU6lgDTiwwjSkEBZE60vq2+6pxM cNNjRwLt9I8xbGhxyIGUBIyKdmzCAzHK1SKK0DlbIomwfw+IZ84MWvFdJAjIHdwGQdD4ci OWyPIv3rNzGFAxyiTwT4E3U7rnTTcnfV5McX9n7bOES+O+R1Q745vd0oHnk2u3tVaFFUk5 jK8G5nSoxsc2Uz+Kg/MLyVE4InNQraW7vxf2rfCVTBPPNRM+Nd3BmcuKtEY+aA== X-Migadu-Spam-Score: -6.13 X-Spam-Score: -6.13 X-Migadu-Queue-Id: 95B321D3BD X-Migadu-Scanner: scn1.migadu.com Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=dTVX1QKM; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org"; dmarc=pass (policy=none) header.from=posteo.net X-TUID: Xfv+R2nJmutD Matt writes: > + (advice-add > + 'ob-shell-async-chunk-callback > + :filter-return > + (lambda (&rest r) > + (let ((result (car r))) > + (should (string= result "1\n2\n")) ; expect value > + result)) > + `((name . ,session-name))) > ... > + (catch 'too-long > + (while (string-match test-ob-shell/uuid-regex (buffer-string)) > + (progn > + (sleep-for 0.01) > + (when (time-less-p wait-time (current-time)) > + (throw 'too-long (ert-fail "Took too long to get result from callback"))))) > + t))) Why not simply doing the `should' test when the `test-ob-shell/uuid-regex' match fails? Instead of returning `t'. Then, we will not need to use advise. -- Ihor Radchenko // yantar92, Org mode contributor, Learn more about Org mode at . Support Org development at , or support my work at