Subject: bug#40790: OOM error in graphical installer tests.

From: Ludovic Courtès <[email-masked]>
Date: Sat, 02 May 2020 15:54:38 +0200

Hi,

Mathieu Othacehe <[email-masked]> skribis:

>> * I have some hangs when doing the final testing in marionette. Still
>>   trying to understand why.
>
> Fixed with c537d2bcb7c652b4776435cd1e2a5119af43dd78.

Cool, sorry for breaking things.  :-/

> Still an issue remaining. "gui-installed-desktop-os-encrypted" closure
> is about 5.5GiB which makes too much files for libisofs:
>
> xorriso : UPDATE :  427934 files added in 19 seconds
> libisofs: FAILURE : HFS+ map nodes aren't implemented
> libisofs: FAILURE : Too much files to mangle, cannot guarantee unique file names
> xorriso : FAILURE : Failed to prepare session write run
> xorriso : NOTE : -return_with SORRY 32 triggered by problem severity FAILURE
>
> Not sure how to fix it. Someone?

I tried the attached patch, which would select just one desktop
environments, thinking it might appease Xorriso, but actually it still
OOMs at the very last step:

--8<---------------cut here---------------start------------->8---
xorriso : UPDATE :  141879 file filters processed in 848 seconds
xorriso : UPDATE :  142026 file filters processed in 849 seconds
xorriso : UPDATE :  142102 file filters processed in 850 seconds
xorriso : NOTE : Copying to System Area: 512 bytes from file '/gnu/store/dvfl5ax7pj6c62f1ccc27qcrcb8nafr7-grub-hybrid-2.04/lib/grub/i386-pc/boot_hybrid.img'
[13266.747348] xorriso invoked oom-killer: gfp_mask=0x100cca(GFP_HIGHUSER_MOVABLE), order=0, oom_score_adj=0
[13266.749415] CPU: 0 PID: 251 Comm: xorriso Not tainted 5.4.36-gnu #1
[13266.750777] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.12.0-59-gc9ba5276e321-prebuilt.qemu.org 04/01/2014
--8<---------------cut here---------------end--------------->8---

Testing again with this extra patch:

diff --git a/gnu/system/vm.scm b/gnu/system/vm.scm
index 6f81ac16ff..9f240b50ee 100644
--- a/gnu/system/vm.scm
+++ b/gnu/system/vm.scm
@@ -356,7 +356,7 @@ INPUTS is a list of inputs (as for packages)."
    #:substitutable? substitutable?
 
    ;; Xorriso seems to be quite memory-hungry, so increase the VM's RAM size.
-   #:memory-size 512))
+   #:memory-size 1024))
 
 (define* (qemu-image #:key
                      (name "qemu-image")

I wonder if why it’s taking so much memory, and whether there’s
something else at play, like temporary files written to the overlaid
tmpfs and thus eating memory.

Thoughts?

Ludo’.

diff --git a/gnu/tests/install.scm b/gnu/tests/install.scm
index 019e21fd39..941958d698 100644
--- a/gnu/tests/install.scm
+++ b/gnu/tests/install.scm
@@ -957,7 +957,7 @@ build (current-guix) and then store a couple of full system images.")
 
 (define* (gui-test-program marionette
                            #:key
-                           (desktop? #f)
+                           (desktops '())
                            (encrypted? #f))
   #~(let ()
       (define (screenshot file)
@@ -971,7 +971,9 @@ build (current-guix) and then store a couple of full system images.")
       (setvbuf (current-output-port) 'none)
       (setvbuf (current-error-port) 'none)
 
-      (marionette-eval* '(use-modules (gnu installer tests))
+      (marionette-eval* '(use-modules (gnu installer tests)
+                                      (srfi srfi-1)
+                                      (srfi srfi-26))
                         #$marionette)
 
       ;; Arrange so that 'converse' prints debugging output to the console.
@@ -1016,7 +1018,9 @@ build (current-guix) and then store a couple of full system images.")
 
       (marionette-eval* '(choose-services installer-socket
                                           #:choose-desktop-environment?
-                                          (const #$desktop?)
+                                          (lambda (desktop)
+                                            (any (cut string-contains desktop <>)
+                                                 '#$desktops))
                                           #:choose-network-service?
                                           (const #f))
                         #$marionette)
@@ -1110,7 +1114,7 @@ build (current-guix) and then store a couple of full system images.")
 
 (define* (guided-installation-test name
                                    #:key
-                                   (desktop? #f)
+                                   (desktops '())
                                    (encrypted? #f)
                                    target-os
                                    (install-size 'guess)
@@ -1132,7 +1136,7 @@ build (current-guix) and then store a couple of full system images.")
                                (lambda (marionette)
                                  (gui-test-program
                                   marionette
-                                  #:desktop? desktop?
+                                  #:desktops desktops
                                   #:encrypted? encrypted?))))
          (command (qemu-command/writable-image image)))
       (run-basic-test target-os command name
@@ -1155,7 +1159,7 @@ build (current-guix) and then store a couple of full system images.")
 ;; desktop environments in a single test to reduce the overhead.
 (define %test-gui-installed-desktop-os-encrypted
   (guided-installation-test "gui-installed-desktop-os-encrypted"
-                            #:desktop? #t
+                            #:desktops '("GNOME")
                             #:encrypted? #t
                             #:target-os
                             (installation-target-desktop-os-for-gui-tests