diff mbox series

[PATH,i-g-t,1/2] intel: Be consistent with test results on simulation

Message ID 20180912093306.23537-1-tvrtko.ursulin@linux.intel.com (mailing list archive)
State New, archived
Headers show
Series [PATH,i-g-t,1/2] intel: Be consistent with test results on simulation | expand

Commit Message

Tvrtko Ursulin Sept. 12, 2018, 9:33 a.m. UTC
From: Tvrtko Ursulin <tvrtko.ursulin@intel.com>

Tests which call intel_require_memory currently always skip on simulation,
unless they fail first due insufficient memory. This can create different
outcomes depending on the simulation environment so move the simulation
skip to the start of the function for 100% consistency in results.

Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Cc: Radoslaw Szwichtenberg <radoslaw.szwichtenberg@intel.com>
---
 lib/intel_os.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Chris Wilson Sept. 12, 2018, 12:02 p.m. UTC | #1
Quoting Tvrtko Ursulin (2018-09-12 10:33:05)
> From: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
> 
> Tests which call intel_require_memory currently always skip on simulation,
> unless they fail first due insufficient memory. This can create different
> outcomes depending on the simulation environment so move the simulation
> skip to the start of the function for 100% consistency in results.
> 
> Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
> Cc: Radoslaw Szwichtenberg <radoslaw.szwichtenberg@intel.com>

Makes sense.

Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
-Chris
diff mbox series

Patch

diff --git a/lib/intel_os.c b/lib/intel_os.c
index 29a27272e782..e1e31e23069b 100644
--- a/lib/intel_os.c
+++ b/lib/intel_os.c
@@ -375,6 +375,8 @@  void intel_require_memory(uint64_t count, uint64_t size, unsigned mode)
 	uint64_t required, total;
 	bool sufficient_memory;
 
+	igt_skip_on_simulation();
+
 	sufficient_memory = __intel_check_memory(count, size, mode,
 						 &required, &total);
 	if (!sufficient_memory) {
@@ -406,8 +408,6 @@  void intel_require_memory(uint64_t count, uint64_t size, unsigned mode)
 		      mode & (CHECK_RAM | CHECK_SWAP) ? "RAM" : "",
 		      mode & CHECK_SWAP ? " + swap": "",
 		      (long long)vfs_file_max());
-
-	igt_skip_on_simulation();
 }
 
 void intel_purge_vm_caches(int drm_fd)