Sleep for race condition testing sandbox/mbloch/manual-restore-tests
authorMichal Bloch <m.bloch@samsung.com>
Mon, 14 Apr 2025 11:24:14 +0000 (13:24 +0200)
committerMichal Bloch <m.bloch@samsung.com>
Mon, 14 Apr 2025 14:14:32 +0000 (16:14 +0200)
Example test usage:
 * dlogutil --monitor -v threadtime SESSION*:D
 * /usr/bin/sessiond --restore-only
 * systemctl restart sessiond

Change-Id: Id97740e161dd13a6a0f190c3890535cb1e626063
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
src/service/src/main_restore.cpp

index 1761c294023b29e7e4e403143698fad31b28b426..f79bd401f1d367819d71899345eb00c597f03bf0 100644 (file)
@@ -109,6 +109,10 @@ static void restore_user_session(const fs::path& user_home_dir)
                LOGW("Could not ensure thread-safety of restoration, but continuing anyway because should be mostly safe regardless");
        }
 
+       LOGW("going to sleep, uid %d", uid);
+       sleep(10);
+       LOGW("woke up, uid %d", uid);
+
        try {
                switch_user_subsession(uid, SUBSESSION_INITIAL_SID, last_subsession);
                if (g_sessiond_context)