diff mbox series

[v2,1/2] tools: tests: add short sleeps between generating edge events

Message ID 20230621084835.114473-2-brgl@bgdev.pl
State New
Headers show
Series [v2,1/2] tools: tests: add short sleeps between generating edge events | expand

Commit Message

Bartosz Golaszewski June 21, 2023, 8:48 a.m. UTC
From: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>

Toggling the gpio-sim pull too fast can lead to losing events by gpiomon.
Add short sleeps between the calls to gpiosim_set_pull.

Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
---
 tools/gpio-tools-test.bats | 4 ++++
 1 file changed, 4 insertions(+)
diff mbox series

Patch

diff --git a/tools/gpio-tools-test.bats b/tools/gpio-tools-test.bats
index cc28f1b..1311fc9 100755
--- a/tools/gpio-tools-test.bats
+++ b/tools/gpio-tools-test.bats
@@ -2072,9 +2072,13 @@  request_release_line() {
 	dut_run_redirect gpiomon --num-events=4 --chip $sim0 4
 
 	gpiosim_set_pull sim0 4 pull-up
+	sleep 0.01
 	gpiosim_set_pull sim0 4 pull-down
+	sleep 0.01
 	gpiosim_set_pull sim0 4 pull-up
+	sleep 0.01
 	gpiosim_set_pull sim0 4 pull-down
+	sleep 0.01
 
 	dut_wait
 	status_is 0