The method have_one_new_sample is raising a timeout failure when expect_execution is executed in a loop as shown in the code below:
samples.each |sample| do
actual = expect_execution { syskit_write task.in_port, sample}
.to { have_one_new_sample task.out_port }
end
It seems some samples have been lost. In my tests cases, samples have 120 elements. To make it works, I created a reader out of the expect_execution.to block as in the code below:
reader = syskit_create_reader task.out_port
samples.each |sample| do
actual = expect_execution { syskit_write task.in_port, sample}
.to { have_one_new_sample reader }
end
Did I do something wrong?
Why the first code did not work and the second one works?