solo5 icon indicating copy to clipboard operation
solo5 copied to clipboard

Fix test_time test.

Open greydot opened this issue 2 years ago • 2 comments

Sometimes sleep() may return a bit earlier than expected, again, due to scheduling reasons. This should be accounted for as well.

For example, on my machine I had this:

# **** Solo5 standalone test_time ****
# 
# Overhead of solo5_yield(): 12518 ns
# [5] Sleeping for one second...
# [5] Slept for 999995014 ns
# [5] ERROR: slept too little (expected at least 1000000000 ns)
# [4] Sleeping for one second...
# [4] Slept for 1000012023 ns
# [3] Sleeping for one second...
# [3] Slept for 1000001308 ns
# [2] Sleeping for one second...
# [2] Slept for 1000001248 ns
# [1] Sleeping for one second...
# [1] Slept for 1000001078 ns
# Solo5: solo5_exit(1) called

greydot avatar Aug 11 '22 17:08 greydot

We probably should look deeper and verify that is an expected behavior. I'm not sure that Solo5 should react like this.

dinosaure avatar Aug 31 '22 10:08 dinosaure

Could it depend on hardware, perchance?

greydot avatar Sep 11 '22 17:09 greydot

I will merge this PR but it seems that the initial error hiddens something bigger than what we expect. I will probably adds fews comments and create an issue from this unexpected behavior. Currently, this PR concerns only tests so that's fine to merge it and release it. Thanks!

dinosaure avatar Nov 04 '22 14:11 dinosaure

@greydot do you know on which platform you observed this? Was it spt, hvt, virtio, ...?

reynir avatar Nov 04 '22 17:11 reynir

@greydot do you know on which platform you observed this? Was it spt, hvt, virtio, ...?

It was spt. Though, I didn't check the others. I'll re-check later.

greydot avatar Nov 07 '22 15:11 greydot