Subject: [bug#55231] [PATCH v7 3/4] tests: Remove extraneous 'with-store' in derivations test.

From: Morgan Arnold <[email-masked]>
Date: Mon, 17 Feb 2025 14:35:07 +0000

From: Maxim Cournoyer <[email-masked]>

* tests/derivations.scm ("derivation fails but keep going"): Remove extraneous
'with-store'.

Change-Id: If30c2d457504b8524cd167f1a145fbbea61b513c
---
 tests/derivations.scm | 45 +++++++++++++++++++++----------------------
 1 file changed, 22 insertions(+), 23 deletions(-)

diff --git a/tests/derivations.scm b/tests/derivations.scm
index efcd21f..72ea9aa 100644
--- a/tests/derivations.scm
+++ b/tests/derivations.scm
@@ -150,29 +150,28 @@ (define* (directory-contents dir #:optional (slurp get-bytevector-all))
 (test-assert "derivation fails but keep going"
   ;; In keep-going mode, 'build-derivations' should fail because of D1, but it
   ;; must return only after D2 has succeeded.
-  (with-store store
-    (let* ((d1 (derivation %store "fails"
-                           %bash `("-c" "false")
-                           #:sources (list %bash)))
-           (d2 (build-expression->derivation %store "sleep-then-succeed"
-                                             `(begin
-                                                ,(random-text)
-                                                ;; XXX: Hopefully that's long
-                                                ;; enough that D1 has already
-                                                ;; failed.
-                                                (sleep 2)
-                                                (mkdir %output)))))
-      (set-build-options %store
-                         #:use-substitutes? #f
-                         #:keep-going? #t)
-      (guard (c ((store-protocol-error? c)
-                 (and (= 100 (store-protocol-error-status c))
-                      (string-contains (store-protocol-error-message c)
-                                       (derivation-file-name d1))
-                      (not (valid-path? %store (derivation->output-path d1)))
-                      (valid-path? %store (derivation->output-path d2)))))
-        (build-derivations %store (list d1 d2))
-        #f))))
+  (let* ((d1 (derivation %store "fails"
+                         %bash `("-c" "false")
+                         #:sources (list %bash)))
+         (d2 (build-expression->derivation %store "sleep-then-succeed"
+                                           `(begin
+                                              ,(random-text)
+                                              ;; XXX: Hopefully that's long
+                                              ;; enough that D1 has already
+                                              ;; failed.
+                                              (sleep 2)
+                                              (mkdir %output)))))
+    (set-build-options %store
+                       #:use-substitutes? #f
+                       #:keep-going? #t)
+    (guard (c ((store-protocol-error? c)
+               (and (= 100 (store-protocol-error-status c))
+                    (string-contains (store-protocol-error-message c)
+                                     (derivation-file-name d1))
+                    (not (valid-path? %store (derivation->output-path d1)))
+                    (valid-path? %store (derivation->output-path d2)))))
+      (build-derivations %store (list d1 d2))
+      #f)))
 
 (test-assert "identical files are deduplicated"
   ;; Note: DATA must be longer than %DEDUPLICATION-MINIMUM-SIZE.
-- 
2.47.1