From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id yNmYJCVt0GLOkAAAbAwnHQ (envelope-from ) for ; Thu, 14 Jul 2022 21:23:17 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id aAeUJCVt0GIkVgAA9RJhRA (envelope-from ) for ; Thu, 14 Jul 2022 21:23:17 +0200 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 4D8DF3810D for ; Thu, 14 Jul 2022 21:23:17 +0200 (CEST) Received: from localhost ([::1]:44112 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oC4Qe-0006F4-Fq for larch@yhetil.org; Thu, 14 Jul 2022 15:23:16 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:48458) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oC4QQ-0006Dx-Vq for guix-patches@gnu.org; Thu, 14 Jul 2022 15:23:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:41164) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oC4QQ-000759-Me for guix-patches@gnu.org; Thu, 14 Jul 2022 15:23:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oC4QQ-0003KF-Ha for guix-patches@gnu.org; Thu, 14 Jul 2022 15:23:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#56563] [PATCH] gnu: tests: Fix guix-data-service test. Resent-From: Timotej Lazar Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 14 Jul 2022 19:23:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 56563 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 56563@debbugs.gnu.org Cc: Timotej Lazar X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.165782653312706 (code B ref -1); Thu, 14 Jul 2022 19:23:02 +0000 Received: (at submit) by debbugs.gnu.org; 14 Jul 2022 19:22:13 +0000 Received: from localhost ([127.0.0.1]:38923 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oC4Pb-0003Iq-70 for submit@debbugs.gnu.org; Thu, 14 Jul 2022 15:22:13 -0400 Received: from lists.gnu.org ([209.51.188.17]:58138) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oC4PW-0003If-Fs for submit@debbugs.gnu.org; Thu, 14 Jul 2022 15:22:10 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:48330) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oC4PW-0005DS-BN for guix-patches@gnu.org; Thu, 14 Jul 2022 15:22:06 -0400 Received: from araneo.si ([2001:15c0:2110:3400::2]:44826) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oC4PU-0005UP-L9 for guix-patches@gnu.org; Thu, 14 Jul 2022 15:22:06 -0400 Received: from araneo.si (localhost.lan [127.0.0.1]) by araneo.si (OpenSMTPD) with ESMTP id 89201200 for ; Thu, 14 Jul 2022 19:21:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=araneo.si; h=from:to:cc :subject:date:message-id:mime-version:content-transfer-encoding; s=20180623; bh=7rz4RIbX8y30JuyjFT4DY/E1MuU=; b=EEc+ZYGuAaMPoDb8 VSWB/byQOGgY8O0K2mjjBl0iUsbQiLRNvP/hileZamurNbjP2DssgcldNQzc9Ruo IzrkDhy9LzY6vTgmyevIqxuw82+iHI/y3OK3Fqdi1ty3t9+OKE4V/7RuaslzwUQU FxK/isF3omNQasjZKcK79y7JZjAXGQ9ScgDUOaXgeDZu8pwwdXzBF07N8uPy+spw umsvLY8sK8qNGq1zkRR7NcOViU4tS1cJ/7JOXu4HNpLaiGfzwE821elArVp0OBXU K2NwWtKG5yuDFNlVcNPoDMm2fwgakL0nzjGCTPWKoYyE+1QoKFBoNtYgkvrFf6P/ 4gOJbA== Received: by araneo.si (OpenSMTPD) with ESMTPSA id 70c4296b (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Thu, 14 Jul 2022 19:21:59 +0000 (UTC) From: Timotej Lazar Date: Thu, 14 Jul 2022 21:21:38 +0200 Message-Id: <20220714192137.23039-1-timotej.lazar@araneo.si> X-Mailer: git-send-email 2.36.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=2001:15c0:2110:3400::2; envelope-from=timotej.lazar@araneo.si; helo=araneo.si X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: "Guix-patches" X-Migadu-Flow: FLOW_IN X-Migadu-To: larch@yhetil.org X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1657826597; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=GILRFXXOcZ5qSh+ybJsJzzZXR5zY4hzxNcf3lmU5Gnk=; b=LCGIA8GgHZBJxuLzU/xsSnFdK+nZ9lzz0l69GDf6dgCyF1UAPmg/AIJ/EacPipoRrKsgLQ Krz1peXU9SxK6e9pIeE2LAcSwG9asYW9+MVwoIkCsvUmfpPsuQi97+NGSDCdUA9KNH8Ud9 ceqYEq8zW1Crr4DojN25m74Ee354lG/G2fXGr5Rvqf3Av+Ib3u0A2j4iLYZnbWePAhHhZq ldv1hL/gNy5+TQYU7i8m2Ax6KBeIE48SaXOpm2I1d+og3NdDw0V8tfUyZ5ZejeEy29uUm0 AA30qrV/MT8FD+dOI6lmGjk4+yiFzt9OL8OGgDZ0VXHoziOL/OgC0oYOc0uFoQ== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1657826597; a=rsa-sha256; cv=none; b=clCq+KCw6vDVXjRAMxPGyx5hXBjMiwB4/HXIKpkjsqsqGDwPL2YHnh9A5TIoOktfwzHMOO FflrPjvaEVUzHF+aCx4zP0xRLYyt9To9HXOWV/mnTZQ6O6dV5xyULBNCflaCQSxqC3iELo bfN1FKnsVncTTD0Fw8C+aIhKRTOdZcsBibSyQdlyyf2IRp8ErXMN/pzVSYgMyCLTRLGek2 ghjtNjMa/xXyy8jKOzfDPppt/TcgNQC+t88kZkBCmqPuzfRXN+fka83Rcnwq/yN64Q5c+x CA8XgPRdTh52raUJYfvTNoJrLfuxfYncB/Bi5UdhtZbrEzIM2wb607gHSBjPSg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=araneo.si header.s=20180623 header.b=EEc+ZYGu; dmarc=fail reason="SPF not aligned (relaxed)" header.from=araneo.si (policy=none); spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: 7.35 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=araneo.si header.s=20180623 header.b=EEc+ZYGu; dmarc=fail reason="SPF not aligned (relaxed)" header.from=araneo.si (policy=none); spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: 4D8DF3810D X-Spam-Score: 7.35 X-Migadu-Scanner: scn0.migadu.com X-TUID: hfoWUxzfrNeR Since revision 32, guix-data-service starts immediately but returns an HTTP error code until initialization is complete. Adjust the test accordingly, and remove the increased startup time limit. * gnu/services/guix.scm (guix-data-service): Use default #:pid-file-timeout. * gnu/tests/guix.scm (guix-data-service): Retry the http-get test several times to give the service time to initialize. --- gnu/services/guix.scm | 2 -- gnu/tests/guix.scm | 19 +++++++++++++------ 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/gnu/services/guix.scm b/gnu/services/guix.scm index 338e027245..dac1e5841a 100644 --- a/gnu/services/guix.scm +++ b/gnu/services/guix.scm @@ -652,8 +652,6 @@ (define (guix-data-service-shepherd-services config) #:user #$user #:group #$group #:pid-file "/var/run/guix-data-service/pid" - ;; Allow time for migrations to run - #:pid-file-timeout 120 #:environment-variables `(,(string-append "GUIX_LOCPATH=" #$glibc-utf8-locales "/lib/locale") diff --git a/gnu/tests/guix.scm b/gnu/tests/guix.scm index a4c3e35e5d..ce62f74b60 100644 --- a/gnu/tests/guix.scm +++ b/gnu/tests/guix.scm @@ -222,14 +222,21 @@ (define marionette ((pid) (number? pid)))))) marionette)) + ;; The service starts immediately but replies with status 500 until + ;; initialization is complete, so keep trying for a while. + (define* (try-http-get attempts) + (let ((status (let-values (((response text) + (http-get #$(simple-format + #f "http://localhost:~A/healthcheck" + forwarded-port)))) + (response-code response)))) + (if (or (= status 200) (<= attempts 1)) + status + (begin (sleep 10) (try-http-get (- attempts 1)))))) + (test-equal "http-get" 200 - (let-values - (((response text) - (http-get #$(simple-format - #f "http://localhost:~A/healthcheck" forwarded-port) - #:decode-body? #t))) - (response-code response))) + (try-http-get 10)) (test-end)))) -- 2.36.1