All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] dm: rtc: random Gitlab results for dm_test_rtc_dual()
@ 2019-10-31  4:10 Heinrich Schuchardt
  2019-12-10 15:18 ` Simon Glass
  0 siblings, 1 reply; 2+ messages in thread
From: Heinrich Schuchardt @ 2019-10-31  4:10 UTC (permalink / raw)
  To: u-boot

Hello Simon,

the gitlab 'sandbox test.py' job seems to be kind of a lottery:

https://gitlab.denx.de/u-boot/custodians/u-boot-efi/-/jobs/25678

Job succeeded

https://gitlab.denx.de/u-boot/custodians/u-boot-efi/-/jobs/25499

/u-boot-efi/test/dm/rtc.c:167, dm_test_rtc_dual():
-EINVAL == cmp_times(&now1, &cmp, false):
Expected -22, got 0\r\r\nFailures: 1'.endswith

dm_test_rtc_dual() fails or succeeds for the same code.

@Tom:
Did you also see such spurious results?

At first sight I could not anything wrong in the dm_test_rtc_dual() test
assuming that the Gitlab environment provides a monotonic clock for the
time() function.

The findings below do not explain the problem:

now2 is read but never used. We are testing that we can get the time
from emul2 later on. So I think this line is not needed.

The offset of emul1 is not set before reading now1. If it were -2 (but I
would not know why it should get to that value), than setting offset + 1
for emul2 would be a NOP. So shouldn't we set the offset of emul1 to a
well defined value before reading now1?

Shouldn't dm_test_rtc_dual() reset the offset of emul2 to 0 before
returning?

Best regards

Heinrich

^ permalink raw reply	[flat|nested] 2+ messages in thread

* dm: rtc: random Gitlab results for dm_test_rtc_dual()
  2019-10-31  4:10 [U-Boot] dm: rtc: random Gitlab results for dm_test_rtc_dual() Heinrich Schuchardt
@ 2019-12-10 15:18 ` Simon Glass
  0 siblings, 0 replies; 2+ messages in thread
From: Simon Glass @ 2019-12-10 15:18 UTC (permalink / raw)
  To: u-boot

Hi Heinrich,

On Wed, 30 Oct 2019 at 22:10, Heinrich Schuchardt <xypron.glpk@gmx.de> wrote:
>
> Hello Simon,
>
> the gitlab 'sandbox test.py' job seems to be kind of a lottery:
>
> https://gitlab.denx.de/u-boot/custodians/u-boot-efi/-/jobs/25678
>
> Job succeeded
>
> https://gitlab.denx.de/u-boot/custodians/u-boot-efi/-/jobs/25499
>
> /u-boot-efi/test/dm/rtc.c:167, dm_test_rtc_dual():
> -EINVAL == cmp_times(&now1, &cmp, false):
> Expected -22, got 0\r\r\nFailures: 1'.endswith
>
> dm_test_rtc_dual() fails or succeeds for the same code.
>
> @Tom:
> Did you also see such spurious results?
>
> At first sight I could not anything wrong in the dm_test_rtc_dual() test
> assuming that the Gitlab environment provides a monotonic clock for the
> time() function.
>
> The findings below do not explain the problem:
>
> now2 is read but never used. We are testing that we can get the time
> from emul2 later on. So I think this line is not needed.
>
> The offset of emul1 is not set before reading now1. If it were -2 (but I
> would not know why it should get to that value), than setting offset + 1
> for emul2 would be a NOP. So shouldn't we set the offset of emul1 to a
> well defined value before reading now1?
>
> Shouldn't dm_test_rtc_dual() reset the offset of emul2 to 0 before
> returning?

I have never seen this problem.

But I notice that the timers are probed one after the other. Although
use_system_time is changed to false (for testing purposes) that still
retains the base_time value which comes from os_localtime(). So the
two timers can have a different time value if the next second ticks
over between the two uclass_get_device() calls and I wonder if the
difference is exactly 1 then you will see the error you mention.

I suspect instead that we need a way to set the actually base_time of
a timer. Then it can be set to the same value for each, at the start
of the test.

Regards,
Simon

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-12-10 15:18 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-31  4:10 [U-Boot] dm: rtc: random Gitlab results for dm_test_rtc_dual() Heinrich Schuchardt
2019-12-10 15:18 ` Simon Glass

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.