Skip to content

[cleaner,tests] cleaner tests pollute cleaner's cache, what affects other tests #4138

@pmoravec

Description

@pmoravec

Briefly saying, 02d52f7 is not sufficient when having concurrent cleaner.

Running avocado tests like:

avocado run -p TESTLOCAL=true --test-runner=runner -t stagetwo tests

we get failures like e.g.:

[stdlog] 2025-09-24 05:26:43,336 avocado.test stacktrace       L0049 ERROR| AssertionError: /var/tmp/avocado_1bp9k0slsos_tests.py.IPv6Test/sosreport-IPv6Test/sosreport-host2-2025-09-24-qoopakl/tmp/sos-test-ipv6.txt does not exist

Because the file is renamed in the archive either to obfuscatedword2/sos-test-ipv6.txt or to tmp/sos-obfuscateduser4-ipv6.txt.

The reason is, even when we want to prevent polluting cleaner's mapping and use --no-update, still the concurrent cleaner puts the entries into its cleaner_cache like:

/etc/sos/cleaner/cleaner_cache/soskeywordmap/3:tmp
/etc/sos/cleaner/cleaner_cache/sosusernamemap/5:test

that a new cleaner sources from.

Furthermore, independent on the avocado testing, this concurrent cleaner behaviour nullifies the effect of --no-update. Because the cleaner with --no-update updates the cache either way, and the next cleaner (with no --no-update) does copy the cache to the mapping file.

Possible solutions:

  • --no-update will not create entries even in the cache. BUT then concurrent cleaner processes can potentially obfuscate the same string differently. Gladly the only impact is on this one cleaner run and nothing else
  • Have extra flag --no-cache-update that will be used primarily only in testing, and will imply --no-update. BUT then the "Furthermore" problem with small effect of --no-update wont be fixed.
  • Pick up keywords in testing in a uniqueness way such that they dont intervene each other. BUT that would limit the ReportWithCleanedKeywords test (obfuscating tmp by purpose).
  • allow running cleaner tests sequentially only - or separated to each other with their own cleaner_cache..? BUT again, the "Furthermore" problem wont be fixed.

Any other idea?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions