Browse Source

HPCC-22657 Fix unittest issues using uncontactable IPs

HPCC-22627 meant the IP's in a file being published, might
be contacted if the meta size info was missing.

In the case of some unit test logical files, the IPs
were made up, and no part size meta info was added.
That causes a hang trying to contact the made up IPs.

Fix by publilshing with size meta data for the purposes
of these unit tests.

Signed-off-by: Jake Smith <jake.smith@lexisnexisrisk.com>
Jake Smith 5 years ago
parent
commit
ba28b4abfc
1 changed files with 8 additions and 0 deletions
  1. 8 0
      testing/unittests/dalitests.cpp

+ 8 - 0
testing/unittests/dalitests.cpp

@@ -490,6 +490,7 @@ public:
             rfn.setRemotePath("//10.150.10.1/c$/thordata/test/ftest" TN "._1_of_1");
             fdesc->setPart(0,rfn);
             fdesc->endCluster(map);
+            fdesc->queryPart(0)->queryProperties().setPropInt64("@size", 123);
             Owned<IDistributedFile> file = queryDistributedFileDirectory().createNew(fdesc);
             file->attach("test::ftest" TN,user);
 #undef TN
@@ -500,6 +501,7 @@ public:
             Owned<IFileDescriptor> fdesc = createFileDescriptor();
             fdesc->setPartMask("ftest" TN "._$P$_of_$N$");
             fdesc->setNumParts(1);
+            fdesc->queryPart(0)->queryProperties().setPropInt64("@size", 123);
             Owned<IGroup> grp = createIGroup("10.150.10.1");
             fdesc->addCluster(grp,map);
             Owned<IDistributedFile> file = queryDistributedFileDirectory().createNew(fdesc);
@@ -520,6 +522,8 @@ public:
             rfn.setRemotePath("//10.150.10.3/c$/thordata/test/ftest" TN "._3_of_3");
             fdesc->setPart(2,rfn);
             fdesc->endCluster(map);
+            for (unsigned p=0; p<fdesc->numParts(); p++)
+                fdesc->queryPart(p)->queryProperties().setPropInt64("@size", 10);
             Owned<IDistributedFile> file = queryDistributedFileDirectory().createNew(fdesc);
             file->attach("test::ftest" TN,user);
 #undef TN
@@ -530,6 +534,8 @@ public:
             Owned<IFileDescriptor> fdesc = createFileDescriptor();
             fdesc->setPartMask("ftest" TN "._$P$_of_$N$");
             fdesc->setNumParts(3);
+            for (unsigned p=0; p<fdesc->numParts(); p++)
+                fdesc->queryPart(p)->queryProperties().setPropInt64("@size", 10);
             fdesc->addCluster(grp3,map);
             Owned<IDistributedFile> file = queryDistributedFileDirectory().createNew(fdesc);
             file->attach("test::ftest" TN,user);
@@ -1744,6 +1750,8 @@ public:
         fdesc->setDefaultDir("/c$/thordata/test");
         fdesc->setPartMask("testfile1._$P$_of_$N$");
         fdesc->setNumParts(5);
+        for (unsigned p=0; p<fdesc->numParts(); p++)
+            fdesc->queryPart(p)->queryProperties().setPropInt64("@size", 10);
         ClusterPartDiskMapSpec mapping;
         fdesc->addCluster(grp1,mapping);
         fdesc->addCluster(grp2,mapping);