aboutsummaryrefslogtreecommitdiff
path: root/unit_tests/scripts/linda/wake_period.lua
diff options
context:
space:
mode:
Diffstat (limited to 'unit_tests/scripts/linda/wake_period.lua')
-rw-r--r--unit_tests/scripts/linda/wake_period.lua5
1 files changed, 3 insertions, 2 deletions
diff --git a/unit_tests/scripts/linda/wake_period.lua b/unit_tests/scripts/linda/wake_period.lua
index e4a900d..d2dccc3 100644
--- a/unit_tests/scripts/linda/wake_period.lua
+++ b/unit_tests/scripts/linda/wake_period.lua
@@ -6,7 +6,7 @@ local lanes = require_lanes_result_1
6local body = function(linda_) 6local body = function(linda_)
7 -- a blocking read that lasts longer than the tested wake_period values 7 -- a blocking read that lasts longer than the tested wake_period values
8 linda_:receive(2, "empty_slot") 8 linda_:receive(2, "empty_slot")
9 return true 9 return "done"
10end 10end
11 11
12-- if we don't cancel the lane, we should wait the whole duration 12-- if we don't cancel the lane, we should wait the whole duration
@@ -22,7 +22,8 @@ local function check_wake_duration(linda_, expected_, do_cancel_)
22 assert(result == false and reason == 'timeout', "unexpected cancel result") 22 assert(result == false and reason == 'timeout', "unexpected cancel result")
23 end 23 end
24 -- this should wait until the linda wakes by itself before the actual receive timeout and sees the cancel request 24 -- this should wait until the linda wakes by itself before the actual receive timeout and sees the cancel request
25 h:join() 25 local r, ret = h:join()
26 assert(r == true and ret == "done")
26 local t1 = lanes.now_secs() 27 local t1 = lanes.now_secs()
27 local delta = t1 - t0 28 local delta = t1 - t0
28 -- the linda should check for cancellation at about the expected period, not earlier 29 -- the linda should check for cancellation at about the expected period, not earlier