[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Bug-mcron] tests/schedule.sh issues
From: |
Ludovic Courtès |
Subject: |
Re: [Bug-mcron] tests/schedule.sh issues |
Date: |
Tue, 20 Mar 2018 17:20:08 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/25.3 (gnu/linux) |
Hello,
Mathieu Lirzin <address@hidden> skribis:
> address@hidden (Ludovic Courtès) writes:
>
>> There’s a couple of issues with tests/schedule.sh in mcron 1.1:
>>
>> 1. It expects to be running in a UTC+1 timezone. I think that can be
>> enforced by doing “export TZ=UTC-1”, at least on GNU systems.
>
> For simplicity I would rather use ‘TZ=UTC0; export TZ’.
Sure.
>> 2. It relies on non-deterministic behavior. Specifically, the order
>> in which ‘mcron --schedule’ shows the foo.guile and the bar.guile
>> jobs relies on the order in which files are traversed by
>> ‘for-each-file’, which is non-deterministic.
>>
>> The fix would be to write ‘for-each-file’ along these lines:
>>
>> (define (for-each-file proc directory)
>> (for-each proc (scandir directory)))
>>
>> because ‘scandir’ sorts entries.
>
> While we are at it maybe we can remove ‘for-each-file’ and inline
> ‘(for-each PROC (scandir DIRECTORY))’ where it is used, no?
Yes, I’d suggest doing that.
> Do you want to send patches fixing those issues or you prefer that I fix
> it myself? Both way are fine with me.
I’ll let you fix them if you don’t mind. :-)
Thanks,
Ludo’.