diff mbox

[i-g-t] igt/gem_wait: Relax assertion for wait completion

Message ID 20180502111326.30196-1-chris@chris-wilson.co.uk (mailing list archive)
State New, archived
Headers show

Commit Message

Chris Wilson May 2, 2018, 11:13 a.m. UTC
When waiting for a finite batch, all that we require is that the batch
completes. If it takes the full second (or longer) for us to wake up and
notice the completed batch is immaterial, so only assert that we don't
report an infinite timeout afterwards.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
---
 tests/gem_wait.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Joonas Lahtinen May 3, 2018, 2:05 p.m. UTC | #1
Quoting Chris Wilson (2018-05-02 14:13:26)
> When waiting for a finite batch, all that we require is that the batch
> completes. If it takes the full second (or longer) for us to wake up and
> notice the completed batch is immaterial, so only assert that we don't
> report an infinite timeout afterwards.
> 
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>

May wanna Cc igt-dev@...

Reviewed-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>

Regards, Joonas
Chris Wilson May 3, 2018, 2:12 p.m. UTC | #2
Quoting Joonas Lahtinen (2018-05-03 15:05:38)
> Quoting Chris Wilson (2018-05-02 14:13:26)
> > When waiting for a finite batch, all that we require is that the batch
> > completes. If it takes the full second (or longer) for us to wake up and
> > notice the completed batch is immaterial, so only assert that we don't
> > report an infinite timeout afterwards.
> > 
> > Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> 
> May wanna Cc igt-dev@...

Seemed to be an i915-centric issue, just matching the test code to
kernel behaviour.
-Chris
diff mbox

Patch

diff --git a/tests/gem_wait.c b/tests/gem_wait.c
index 1d10055bb..61d8a4059 100644
--- a/tests/gem_wait.c
+++ b/tests/gem_wait.c
@@ -113,7 +113,7 @@  static void basic(int fd, unsigned engine, unsigned flags)
 			igt_spin_batch_set_timeout(spin, NSEC_PER_SEC/2);
 			wait.timeout_ns = NSEC_PER_SEC; /* 1.0s */
 			igt_assert_eq(__gem_wait(fd, &wait), 0);
-			igt_assert(wait.timeout_ns > 0);
+			igt_assert(wait.timeout_ns >= 0);
 		} else {
 			wait.timeout_ns = -1;
 			igt_assert_eq(__gem_wait(fd, &wait), 0);