Skip to contentSkip to conversation

tests/fetch.py: Add test showing recursion failure in url mapping

RFC PATCH In review Mark Hatle 1 participant 2 messages Sep 10, 2015

lore
Share & tools
lore

Mark Hatle

author
#0 lore raw

RFC PATCH 1/1 tests/fetch.py: Add test showing recursion failure in url mapping

Adding this test results in a failure:

RuntimeError: maximum recursion depth exceeded in cmp

The mirror processing runs over and over and over on the same URL until the stack is exhausted. I do not have a proposed solution ot this problem.

---
 lib/bb/tests/fetch.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
lib/bb/tests/fetch.py +2 -1
index 8486224..39df138 100644
@@ -405,7 +405,8 @@ class MirrorUriTest(FetcherTest):
                                 'http://otherdownloads.yoctoproject.org/downloads/bitbake-1.0.tar.gz',
                                 'http://downloads2.yoctoproject.org/downloads/bitbake-1.0.tar.gz'])
 
-    recmirrorvar = "https://.*/[^/]*    http://AAAA/A/A/A/ \n"
+    recmirrorvar = "https://.*/[^/]*    http://AAAA/A/A/A/ \n" \
+                   "https://.*/[^/]*    https://BBBB/B/B/B/ \n"
 
     def test_recursive(self):
         fetcher = bb.fetch.FetchData("https://downloads.yoctoproject.org/releases/bitbake/bitbake-1.0.tar.gz", self.d)
Signature · 1 line
1.9.3
author
#1 lore raw

After sending this, I realized there was an easy way to break the recursion. See the patch sent after this one.

Quoted 27 lines · Mark Hatle

Adding this test results in a failure:

RuntimeError: maximum recursion depth exceeded in cmp

The mirror processing runs over and over and over on the same URL until the stack is exhausted. I do not have a proposed solution ot this problem.

---
 lib/bb/tests/fetch.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
lib/bb/tests/fetch.py +2 -1
index 8486224..39df138 100644
@@ -405,7 +405,8 @@ class MirrorUriTest(FetcherTest):
                                 'http://otherdownloads.yoctoproject.org/downloads/bitbake-1.0.tar.gz',
                                 'http://downloads2.yoctoproject.org/downloads/bitbake-1.0.tar.gz'])
 
-    recmirrorvar = "https://.*/[^/]*    http://AAAA/A/A/A/ \n"
+    recmirrorvar = "https://.*/[^/]*    http://AAAA/A/A/A/ \n" \
+                   "https://.*/[^/]*    https://BBBB/B/B/B/ \n"
 
     def test_recursive(self):
         fetcher = bb.fetch.FetchData("https://downloads.yoctoproject.org/releases/bitbake/bitbake-1.0.tar.gz", self.d)