From b1b3ef2b2b23a63687b93a78ebeb1bbcb23ed5d2 Mon Sep 17 00:00:00 2001 From: Brett Smith Date: Thu, 12 Jan 2023 16:48:12 -0500 Subject: [PATCH] 19886: Bugfix UUID generation in crunch-run tests The previous code was generating UUIDs with a 30-character last part. Arvados-DCO-1.1-Signed-off-by: Brett Smith --- lib/crunchrun/crunchrun_test.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/crunchrun/crunchrun_test.go b/lib/crunchrun/crunchrun_test.go index 8da933a730..735385a6f0 100644 --- a/lib/crunchrun/crunchrun_test.go +++ b/lib/crunchrun/crunchrun_test.go @@ -188,9 +188,10 @@ func (client *ArvTestClient) Create(resourceType string, if resourceType == "collections" && output != nil { mt := parameters["collection"].(arvadosclient.Dict)["manifest_text"].(string) + md5sum := md5.Sum([]byte(mt)) outmap := output.(*arvados.Collection) - outmap.PortableDataHash = fmt.Sprintf("%x+%d", md5.Sum([]byte(mt)), len(mt)) - outmap.UUID = fmt.Sprintf("zzzzz-4zz18-%15.15x", md5.Sum([]byte(mt))) + outmap.PortableDataHash = fmt.Sprintf("%x+%d", md5sum, len(mt)) + outmap.UUID = fmt.Sprintf("zzzzz-4zz18-%015x", md5sum[:7]) } return nil -- 2.30.2