test suite reviews and discussions
 help / color / mirror / Atom feed
* [dts] [PATCH] framework: Adding limit for make job execution
@ 2017-09-15 16:22 Radoslaw Biernacki
  2017-09-15 16:22 ` [dts] [PATCH] framework/crb: Throwing exception in case requested core configuration cannot be fulfilled Radoslaw Biernacki
  2017-09-18 10:14 ` [dts] [PATCH] framework: Adding limit for make job execution Liu, Yong
  0 siblings, 2 replies; 4+ messages in thread
From: Radoslaw Biernacki @ 2017-09-15 16:22 UTC (permalink / raw)
  To: dts; +Cc: jianbo.liu, herbert.guan, Radoslaw Biernacki

Unlimited parralel job execution cause OOM on memory constrained targets

Signed-off-by: Radoslaw Biernacki <radoslaw.biernacki@linaro.org>
---
 framework/project_dpdk.py | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)

diff --git a/framework/project_dpdk.py b/framework/project_dpdk.py
index 402ac8d..23d1d7c 100644
--- a/framework/project_dpdk.py
+++ b/framework/project_dpdk.py
@@ -210,7 +210,8 @@ class DPDKdut(Dut):
         self.send_expect("rm -rf %s" % r'./app/test/test_pci_sysfs.res.o' , "#")
 
         # compile
-        out = self.send_expect("make -j install T=%s %s" % (target, extra_options), "# ", build_time)
+        out = self.send_expect("make -j %d install T=%s %s" % 
+            (self.number_of_cores, target, extra_options), "# ", build_time)
         #should not check test app compile status, because if test compile fail,
         #all unit test can't exec, but others case will exec sucessfull 
         self.build_install_dpdk_test_app(target, build_time)
@@ -253,9 +254,9 @@ class DPDKdut(Dut):
         assert ("No rule to make" not in out), "No rule to make error..."
 
     def build_install_dpdk_test_app(self, target, build_time, os_type="linux"):
-        cmd_build_test = "make -j -C test/"
+        cmd_build_test = "make -j %d -C test/" % (self.number_of_cores)
         if os_type == "freebsd":
-            cmd_build_test = "make -j -C test/ CC=gcc48"
+            cmd_build_test = "make -j %d -C test/ CC=gcc48" % (self.number_of_cores)
 
         self.send_expect(cmd_build_test, "# ", build_time)
         app_list = ['./test/test/test', './test/test-acl/testacl', './test/test-pipeline/testpipeline', './test/cmdline_test/cmdline_test']
@@ -380,7 +381,8 @@ class DPDKdut(Dut):
         self.send_expect("rm -rf %s" % r'./app/test/test_resource_c.res.o' , "#")
         self.send_expect("rm -rf %s" % r'./app/test/test_resource_tar.res.o' , "#")
         self.send_expect("rm -rf %s" % r'./app/test/test_pci_sysfs.res.o' , "#")
-        return self.send_expect("make -j -C %s %s" % (folder, extra_options),
+        return self.send_expect("make -j %d -C %s %s" % (self.number_of_cores,
+                                                         folder, extra_options),
                                 "# ", timeout)
 
     def build_dpdk_apps_freebsd(self, folder, extra_options):
@@ -390,7 +392,8 @@ class DPDKdut(Dut):
         self.send_expect("rm -rf %s" % r'./app/test/test_resource_c.res.o' , "#")
         self.send_expect("rm -rf %s" % r'./app/test/test_resource_tar.res.o' , "#")
         self.send_expect("rm -rf %s" % r'./app/test/test_pci_sysfs.res.o' , "#")
-        return self.send_expect("make -j -C %s %s CC=gcc48" % (folder, extra_options),
+        return self.send_expect("make -j %d -C %s %s CC=gcc48" % (self.number_of_cores,
+                                                                  folder, extra_options),
                                 "# ", 180)
 
     def get_blacklist_string(self, target, nic):
-- 
1.9.1

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [dts] [PATCH] framework/crb: Throwing exception in case requested core configuration cannot be fulfilled
  2017-09-15 16:22 [dts] [PATCH] framework: Adding limit for make job execution Radoslaw Biernacki
@ 2017-09-15 16:22 ` Radoslaw Biernacki
  2017-09-18 10:15   ` Liu, Yong
  2017-09-18 10:14 ` [dts] [PATCH] framework: Adding limit for make job execution Liu, Yong
  1 sibling, 1 reply; 4+ messages in thread
From: Radoslaw Biernacki @ 2017-09-15 16:22 UTC (permalink / raw)
  To: dts; +Cc: jianbo.liu, herbert.guan, Radoslaw Biernacki

Throwing exception instead of returning empty core set cause proper
error handling. Returning empty core set cause invalid parameter being
passed to EAL which in turn cause early exit from test program.

Signed-off-by: Radoslaw Biernacki <radoslaw.biernacki@linaro.org>
---
 framework/crb.py | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/framework/crb.py b/framework/crb.py
index facf319..dd29a8b 100644
--- a/framework/crb.py
+++ b/framework/crb.py
@@ -694,9 +694,11 @@ class Crb(object):
                 n['core']) in core_list]
             temp = []
             if len(core_list) < nr_cores:
-                return []
+                raise ValueError("Cannot get requested core configuration "
+                                 "requested {} have {}".format(config, self.cores))
             if len(sockList) < nr_sockets:
-                return []
+                raise ValueError("Cannot get requested core configuration "
+                                 "requested {} have {}".format(config, self.cores))
             # recheck the core_list and create the thread_list
             i = 0
             for sock in sockList:
-- 
1.9.1

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [dts] [PATCH] framework: Adding limit for make job execution
  2017-09-15 16:22 [dts] [PATCH] framework: Adding limit for make job execution Radoslaw Biernacki
  2017-09-15 16:22 ` [dts] [PATCH] framework/crb: Throwing exception in case requested core configuration cannot be fulfilled Radoslaw Biernacki
@ 2017-09-18 10:14 ` Liu, Yong
  1 sibling, 0 replies; 4+ messages in thread
From: Liu, Yong @ 2017-09-18 10:14 UTC (permalink / raw)
  To: Radoslaw Biernacki, dts; +Cc: jianbo.liu, herbert.guan

Thanks Radoslaw, applied.

On 09/16/2017 12:22 AM, Radoslaw Biernacki wrote:
> Unlimited parralel job execution cause OOM on memory constrained targets
>
> Signed-off-by: Radoslaw Biernacki<radoslaw.biernacki@linaro.org>
> ---
>   framework/project_dpdk.py | 13 ++++++++-----
>   1 file changed, 8 insertions(+), 5 deletions(-)

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [dts] [PATCH] framework/crb: Throwing exception in case requested core configuration cannot be fulfilled
  2017-09-15 16:22 ` [dts] [PATCH] framework/crb: Throwing exception in case requested core configuration cannot be fulfilled Radoslaw Biernacki
@ 2017-09-18 10:15   ` Liu, Yong
  0 siblings, 0 replies; 4+ messages in thread
From: Liu, Yong @ 2017-09-18 10:15 UTC (permalink / raw)
  To: Radoslaw Biernacki, dts; +Cc: jianbo.liu, herbert.guan

Thanks Radoslaw, applied into master branch.

On 09/16/2017 12:22 AM, Radoslaw Biernacki wrote:
> Throwing exception instead of returning empty core set cause proper
> error handling. Returning empty core set cause invalid parameter being
> passed to EAL which in turn cause early exit from test program.
>
> Signed-off-by: Radoslaw Biernacki<radoslaw.biernacki@linaro.org>

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2017-09-18  1:32 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-09-15 16:22 [dts] [PATCH] framework: Adding limit for make job execution Radoslaw Biernacki
2017-09-15 16:22 ` [dts] [PATCH] framework/crb: Throwing exception in case requested core configuration cannot be fulfilled Radoslaw Biernacki
2017-09-18 10:15   ` Liu, Yong
2017-09-18 10:14 ` [dts] [PATCH] framework: Adding limit for make job execution Liu, Yong

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).