[gnome-software/wip/mcrha/flatpak-test-fix] flatpak: Let reliable crash the Flatpak self test



commit ab482494220491b753473c14138f23067e537b80
Author: Milan Crha <mcrha redhat com>
Date:   Thu Feb 3 09:12:26 2022 +0100

    flatpak: Let reliable crash the Flatpak self test
    
    Add a one second sleep to the self test to give time the file monitor
    to deliver the Flatpak remote changes, which causes clear of the plugin
    cache, which in turn causes reliable crash of the test.

 plugins/flatpak/gs-self-test.c | 4 ++++
 1 file changed, 4 insertions(+)
---
diff --git a/plugins/flatpak/gs-self-test.c b/plugins/flatpak/gs-self-test.c
index cad0737e5..fcf307a59 100644
--- a/plugins/flatpak/gs-self-test.c
+++ b/plugins/flatpak/gs-self-test.c
@@ -1187,6 +1187,10 @@ flatpak_bundle_or_ref_helper (GsPluginLoader *plugin_loader,
                                           GS_PLUGIN_REFINE_FLAGS_REQUIRE_RUNTIME;
        }
 
+       /* Wait for the flatpak changes to be delivered through the file
+          monitor notifications, which will cleanup plugin cache. */
+       g_usleep (G_USEC_PER_SEC);
+
        /* convert it to a GsApp */
        g_object_unref (plugin_job);
        plugin_job = gs_plugin_job_newv (GS_PLUGIN_ACTION_FILE_TO_APP,


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]