storaged-project / udisks

The UDisks project provides a daemon, tools and libraries to access and manipulate disks, storage devices and technologies.
https://storaged.org/doc/udisks2-api/latest/
Other
348 stars 142 forks source link

tests: Temporarily disable journal flight recorder #1283

Closed vojtechtrefny closed 5 months ago

vojtechtrefny commented 5 months ago

The flight recorder should save entries in journal that occured when running the tests but currently the code saves the entire journal for every test case making the log around 500 MiB for every test suite run. Until we can figure out what's happening we need to disable this to protect our Jenkins from running out of space.

vojtechtrefny commented 5 months ago
In [1]: from time import monotonic
In [2]: from systemd import journal
In [3]: now = monotonic()
In [4]: j = journal.Reader(converters={"MESSAGE": lambda x: x.decode(errors="replace")})
In [5]: j.this_boot()
In [6]: j.seek_monotonic(now)
In [7]: j.get_next()
Out[7]: 
{'_SOURCE_MONOTONIC_TIMESTAMP': datetime.timedelta(0),
 '_TRANSPORT': 'kernel',
 'PRIORITY': 5,
 'SYSLOG_FACILITY': 0,
 'SYSLOG_IDENTIFIER': 'kernel',
 'MESSAGE': 'Linux version 6.8.11-200.fc39.x86_64 (mockbuild@538df1ba59694851b947e1fab774e672) (gcc (GCC) 13.3.1 20240522 (Red Hat 13.3.1-1), GNU ld version 2.40-14.fc39) #1 SMP PREEMPT_DYNAMIC Sun May 26 20:05:41 UTC 2024',
 '_BOOT_ID': UUID('c0db012d-3687-4f58-9bc9-9bf49599358e'),
 '_MACHINE_ID': UUID('4b226a43-a5b1-4012-9cb8-1659ad228171'),
 '_HOSTNAME': 'aida',
 '_RUNTIME_SCOPE': 'initrd',
 '__REALTIME_TIMESTAMP': datetime.datetime(2024, 6, 7, 6, 46, 38, 2772, tzinfo=datetime.timezone(datetime.timedelta(seconds=7200), 'CEST')),
 '__MONOTONIC_TIMESTAMP': journal.Monotonic(timestamp=datetime.timedelta(seconds=5, microseconds=406514), bootid=UUID('c0db012d-3687-4f58-9bc9-9bf49599358e')),
 '__CURSOR': 's=feaca688e3c44d79b66ac019bba9364d;i=104102d;b=c0db012d36874f589bc99bf49599358e;m=527f32;t=61a457c231254;x=bd0a7446ac8fa09a'}

Looks like seek_monotonic doesn't work (or we are using it wrong, but it seems to be working as expected on C9S with systemd 252).

vojtechtrefny commented 5 months ago

I can change this in Jenkins configuration for now, it will be easier.