Bug 14346

Summary: test_rpm_query_nonroot fails to delete user
Product: [QA/Testing] Runtime Testing Reporter: Alejandro <alejandro>
Component: oeqa/runtimeAssignee: Pavel Zhukov <pavel>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: Medium CC: luca.ceresoli, randy.macleod, steve
Version: unspecified   
Target Milestone: 4.2   
Hardware: x86   
OS: Multiple   
Whiteboard: AB-INT
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: No (bug/feature does not impact docs)
Attachments:
Description Flags
Full do_testimage log none

Description Alejandro 2021-04-14 22:57:00 UTC
While running the test, the system tries to delete a user, this couldnt happen because the user was still in use, likely a race condition.

https://autobuilder.yoctoproject.org/typhoon/#/builders/107/builds/1547/steps/13/logs/stdio

Traceback (most recent call last):
  File "/home/pokybuild/yocto-worker/qemuppc-alt/build/meta/lib/oeqa/core/decorator/__init__.py", line 36, in wrapped_f
    return func(*args, **kwargs)
  File "/home/pokybuild/yocto-worker/qemuppc-alt/build/meta/lib/oeqa/runtime/cases/rpm.py", line 77, in test_rpm_query_nonroot
    unset_up_test_user(tuser)
  File "/home/pokybuild/yocto-worker/qemuppc-alt/build/meta/lib/oeqa/runtime/cases/rpm.py", line 69, in unset_up_test_user
    self.assertTrue(status == 0, msg=msg)
AssertionError: False is not true : Failed to erase user: userdel: user test1 is currently used by process 6033
Comment 1 Randy MacLeod 2021-04-15 14:43:38 UTC
Happens on dunfell and qemuppc
Comment 2 Steve Sakoman 2021-05-06 20:11:37 UTC
Another occurrence on dunfell (ubuntu1804-ty-1, qemuppc-alt)

https://autobuilder.yoctoproject.org/typhoon/#/builders/107/builds/1625
Comment 3 Randy MacLeod 2021-08-12 14:46:48 UTC
We've done 100s of builds since this was last seen in May so closing.
Comment 4 Luca Ceresoli 2022-10-06 20:17:08 UTC
Happened again today :-(

https://autobuilder.yoctoproject.org/typhoon/#/builders/107/builds/3621/steps/12/logs/stdio

qemuppc-alt on debian11-ty-3
Comment 5 Luca Ceresoli 2022-10-06 20:19:15 UTC
Created attachment 4906 [details]
Full do_testimage log
Comment 6 Luca Ceresoli 2022-10-06 20:25:19 UTC
Probably a race condition in rpm.RpmBasicTest.test_rpm_query_nonroot.

unset_up_test_user() waits up to 30 seconds to "ensure no test1 process in running", then it fails with this error.
Comment 7 Randy MacLeod 2022-10-13 14:46:41 UTC
Also on master.
Comment 8 Randy MacLeod 2022-10-20 14:59:14 UTC
backports dunfell and kirkstone
Comment 9 Randy MacLeod 2022-11-10 15:44:40 UTC
Pavel, are you able to work on this bug or should I move it to unassigned?
Comment 10 Pavel Zhukov 2022-11-10 16:46:51 UTC
(In reply to comment #9)
> Pavel, are you able to work on this bug or should I move it to unassigned?

Hi Randy,

I'm able to work on this bug. Need few days to sort few things out
Comment 11 Pavel Zhukov 2022-11-13 11:25:33 UTC
Looks like we hit this: https://github.com/systemd/systemd/issues/8598
Comment 12 Pavel Zhukov 2022-11-13 11:32:31 UTC
There are few options atm:
- Increase timeout (30 secs currently)
- # systemctl mask user@.service - I'm not sure that will be consequences of disabling user services on project level
- force removal of the user (with "-f" option) 
- Wait for systemd bug to be closed (or fix it :) )
Comment 14 Pavel Zhukov 2023-01-12 12:59:19 UTC
Hopefully "fixed". Feel free to reopen if happens again