Skip to contentSkip to conversation

support/testing/tests/package/test_python_flask*: increase time after server startup

PATCH In review Thomas Petazzoni via buildroot 2 participants 6 messages Nov 1, 2022 – Nov 14, 2022

lore
Share & tools
lore
#0 lore raw

PATCH 1/3 support/testing/tests/package/test_python_flask*: increase time after server startup

It seems like on Gitlab CI, the runners are quite slow, and the Flask server does not startup in the 15 seconds we give it. So increase this to 30 seconds before trying to contact the Flask server.

Hopefully fixes:

https://gitlab.com/buildroot.org/buildroot/-/jobs/3249828594

---
 support/testing/tests/package/test_python_flask.py              | 2 +-
 support/testing/tests/package/test_python_flask_expects_json.py | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
support/testing/tests/package/test_python_flask.py +1 -1
index ef5d96bae9..9d8587e918 100644
@@ -21,7 +21,7 @@ class TestPythonPy3Flask(TestPythonPackageBase):
         _, exit_code = self.emulator.run(cmd, timeout=self.timeout)
 
         # Give enough time for the flask server to start up
-        time.sleep(15)
+        time.sleep(30)
 
         cmd = "wget -q -O - http://127.0.0.1:5000/"
         output, exit_code = self.emulator.run(cmd, timeout=self.timeout)
support/testing/tests/package/test_python_flask_expects_json.py +1 -1
index 5576cba2b4..91b8bf21b7 100644
@@ -31,7 +31,7 @@ class TestPythonPy3FlaskExpectsJson(TestPythonPackageBase):
         _, exit_code = self.emulator.run(cmd, timeout=self.timeout)
 
         # Give enough time for the flask server to start up
-        time.sleep(15)
+        time.sleep(30)
 
         self.try_json("""{"email": "test", "name": "test"}""", 200)
         self.try_json("""{"email": "test", "name": 2}""", 400)
Signature · 6 lines
2.37.3

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#1 lore raw

PATCH 2/3 support/testing/tests/package/test_python_crossbar: use ext2 instead of cpio

The CPIO filesystem generated by the test_python_crossbar test is too large, and doesn't fit as an initramfs in the 256MB of RAM available in the versatilepb machine. This causes a "Initramfs unpacking failed:
write error" when booting, and many files being missing from the root filesystem, ultimately causing the test to fail.

It would make sense to switch all test cases to use ext2 + a hard-drive, but for now, let's fix the few test cases that are causing problems.

Fixes:

https://gitlab.com/buildroot.org/buildroot/-/jobs/3249828587

---
 .../testing/tests/package/test_python_crossbar.py   | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)
support/testing/tests/package/test_python_crossbar.py +11 -2
index 83649aeec2..178b16be82 100644
@@ -1,4 +1,5 @@
 from tests.package.test_python import TestPythonPackageBase
+import os
 
 
 class TestPythonPy3Crossbar(TestPythonPackageBase):
@@ -13,8 +14,16 @@ class TestPythonPy3Crossbar(TestPythonPackageBase):
         BR2_TOOLCHAIN_EXTERNAL_BOOTLIN_ARMV5_EABI_GLIBC_STABLE=y
         BR2_PACKAGE_PYTHON3=y
         BR2_PACKAGE_PYTHON_CROSSBAR=y
-        BR2_TARGET_ROOTFS_CPIO=y
-        # BR2_TARGET_ROOTFS_TAR is not set
+        BR2_TARGET_ROOTFS_EXT2=y
+        BR2_TARGET_ROOTFS_EXT2_SIZE="120M"
         """
     sample_scripts = ["tests/package/sample_python_crossbar.py"]
     timeout = 60
+
+    def login(self):
+        ext2_file = os.path.join(self.builddir, "images", "rootfs.ext2")
+        self.emulator.boot(arch="armv5",
+                           kernel="builtin",
+                           options=["-drive", "file=%s,if=scsi,format=raw" % ext2_file],
+                           kernel_cmdline=["rootwait", "root=/dev/sda"])
+        self.emulator.login()
Signature · 6 lines
2.37.3

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#2 lore raw

Re: [Buildroot] [PATCH 2/3] support/testing/tests/package/test_python_crossbar: use ext2 instead of cpio

Quoted 12 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Thomas" == Thomas Petazzoni via buildroot <[email protected]> writes:

The CPIO filesystem generated by the test_python_crossbar test is too large, and doesn't fit as an initramfs in the 256MB of RAM available in the versatilepb machine. This causes a "Initramfs unpacking failed:
write error" when booting, and many files being missing from the root filesystem, ultimately causing the test to fail.

It would make sense to switch all test cases to use ext2 + a hard-drive, but for now, let's fix the few test cases that are causing problems.

Quoted 5 lines

Fixes:

https://gitlab.com/buildroot.org/buildroot/-/jobs/3249828587

Committed to 2022.08.x and 2022.02.x, thanks.

Signature · 5 lines
Bye, Peter Korsgaard
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#3 lore raw

PATCH 3/3 support/testing/tests/package/test_gdb.py: drop version-specific tests

In reply to Thomas Petazzoni via buildroot

Back when support/testing/tests/package/test_gdb was introduced, there was a significant difference in how gdb < 10 and gdb >= 10 were handled in gdb.mk, which explained why we were testing both gdb 9.x and gdb 11.x.

However, support for gdb 9.x has now been dropped, and we only support gdb >= 10.x, so testing gdb 9.x and 11.x separately no longer make much sense. In addition:

- other GDB tests in the same file already test the default version, which is now 11.x, meaning we in fact have duplicated tests between the ones testing the default version and the ones testing 11.x specifically

- GDB 9.x has been removed, which means all the tests testing GDB 9.x are failing, with a Config.in.legacy build error.

Fixes:

https://gitlab.com/buildroot.org/buildroot/-/jobs/3249828456 (TestGdbHostOnly9x)
https://gitlab.com/buildroot.org/buildroot/-/jobs/3249828454 (TestGdbHostGdbserver9x)
https://gitlab.com/buildroot.org/buildroot/-/jobs/3249828451 (TestGdbHostGdbTarget9x)

---
 support/testing/tests/package/test_gdb.py | 108 ----------------------
 1 file changed, 108 deletions(-)
support/testing/tests/package/test_gdb.py +0 -108
index a7b0870644..4712162349 100644
@@ -91,114 +91,6 @@ class TestGdbFullTarget(BaseGdb):
         self.verify_gdb()
 
 
-class TestGdbHostOnly9x(BaseGdb):
-    config = \
-        infra.basetest.MINIMAL_CONFIG + \
-        """
-        BR2_arm=y
-        BR2_TOOLCHAIN_EXTERNAL=y
-        BR2_TOOLCHAIN_EXTERNAL_BOOTLIN=y
-        BR2_PACKAGE_HOST_GDB=y
-        BR2_GDB_VERSION_9_2=y
-        """
-
-    def test_run(self):
-        self.verify_host_gdb()
-
-
-class TestGdbHostGdbserver9x(BaseGdb):
-    config = \
-        """
-        BR2_arm=y
-        BR2_TOOLCHAIN_EXTERNAL=y
-        BR2_TOOLCHAIN_EXTERNAL_BOOTLIN=y
-        BR2_PACKAGE_HOST_GDB=y
-        BR2_GDB_VERSION_9_2=y
-        BR2_PACKAGE_GDB=y
-        BR2_TARGET_ROOTFS_CPIO=y
-        # BR2_TARGET_ROOTFS_TAR is not set
-        """
-
-    def test_run(self):
-        self.verify_host_gdb()
-        self.boot()
-        self.verify_gdbserver()
-
-
-class TestGdbHostGdbTarget9x(BaseGdb):
-    config = \
-        """
-        BR2_arm=y
-        BR2_TOOLCHAIN_EXTERNAL=y
-        BR2_TOOLCHAIN_EXTERNAL_BOOTLIN=y
-        BR2_PACKAGE_HOST_GDB=y
-        BR2_GDB_VERSION_9_2=y
-        BR2_PACKAGE_GDB=y
-        BR2_PACKAGE_GDB_DEBUGGER=y
-        BR2_TARGET_ROOTFS_CPIO=y
-        # BR2_TARGET_ROOTFS_TAR is not set
-        """
-
-    def test_run(self):
-        self.verify_host_gdb()
-        self.boot()
-        self.verify_gdb()
-
-
-class TestGdbHostOnly11x(BaseGdb):
-    config = \
-        infra.basetest.MINIMAL_CONFIG + \
-        """
-        BR2_arm=y
-        BR2_TOOLCHAIN_EXTERNAL=y
-        BR2_TOOLCHAIN_EXTERNAL_BOOTLIN=y
-        BR2_PACKAGE_HOST_GDB=y
-        BR2_GDB_VERSION_11=y
-        """
-
-    def test_run(self):
-        self.verify_host_gdb()
-
-
-class TestGdbHostGdbserver11x(BaseGdb):
-    config = \
-        """
-        BR2_arm=y
-        BR2_TOOLCHAIN_EXTERNAL=y
-        BR2_TOOLCHAIN_EXTERNAL_BOOTLIN=y
-        BR2_PACKAGE_HOST_GDB=y
-        BR2_GDB_VERSION_11=y
-        BR2_PACKAGE_GDB=y
-        BR2_TARGET_ROOTFS_CPIO=y
-        # BR2_TARGET_ROOTFS_TAR is not set
-        """
-
-    def test_run(self):
-        self.verify_host_gdb()
-        self.boot()
-        self.verify_gdbserver()
-
-
-class TestGdbHostGdbTarget11x(BaseGdb):
-    config = \
-        """
-        BR2_arm=y
-        BR2_TOOLCHAIN_EXTERNAL=y
-        BR2_TOOLCHAIN_EXTERNAL_BOOTLIN=y
-        BR2_PACKAGE_HOST_GDB=y
-        BR2_GDB_VERSION_11=y
-        BR2_PACKAGE_GDB=y
-        BR2_PACKAGE_GDB_DEBUGGER=y
-        BR2_TARGET_ROOTFS_CPIO=y
-        # BR2_TARGET_ROOTFS_TAR is not set
-        """
-
-    def test_run(self):
-        self.verify_host_gdb()
-        self.boot()
-        self.verify_gdb()
-
-
 class TestGdbArc(BaseGdb):
     config = \
         """
Signature · 6 lines
2.37.3

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#4 lore raw
In reply to Thomas Petazzoni via buildroot
Quoted 6 lines · On Tue, 1 Nov 2022 19:13:17 +0100 Thomas Petazzoni via buildroot…

It seems like on Gitlab CI, the runners are quite slow, and the Flask server does not startup in the 15 seconds we give it. So increase this to 30 seconds before trying to contact the Flask server.

Hopefully fixes:

Quoted 7 lines

https://gitlab.com/buildroot.org/buildroot/-/jobs/3249828594

---
 support/testing/tests/package/test_python_flask.py              | 2 +-
 support/testing/tests/package/test_python_flask_expects_json.py | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

Series applied to master.

Thomas

Signature · 7 lines
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#5 lore raw
In reply to Thomas Petazzoni via buildroot
Quoted 11 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Thomas" == Thomas Petazzoni via buildroot <[email protected]> writes:

It seems like on Gitlab CI, the runners are quite slow, and the Flask server does not startup in the 15 seconds we give it. So increase this to 30 seconds before trying to contact the Flask server.

Hopefully fixes:

https://gitlab.com/buildroot.org/buildroot/-/jobs/3249828594

Committed to 2022.08.x and 2022.02.x, thanks.

Signature · 5 lines
Bye, Peter Korsgaard
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot