From 2b87a8252f503bbcb25fe7075501bce5574e25c7 Mon Sep 17 00:00:00 2001 From: Okan Kocabalkanli Date: Fri, 29 Jul 2022 17:10:05 +0000 Subject: [PATCH] updated the release tag --- .../test/performancetest/transmitter.go | 20 ++++--------------- 1 file changed, 4 insertions(+), 16 deletions(-) diff --git a/integration/test/performancetest/transmitter.go b/integration/test/performancetest/transmitter.go index e1c870bf03..52b803d39a 100644 --- a/integration/test/performancetest/transmitter.go +++ b/integration/test/performancetest/transmitter.go @@ -342,25 +342,13 @@ Param: commit hash in terms of string */ func (transmitter * TransmitterAPI) UpdateReleaseTag(hash string) error{ var err error - var ae *types.ConditionalCheckFailedException packet := make(map[string]interface{}) packet[HASH] = hash packet[IS_RELEASE] = true - for attemptCount:=0; attemptCount< MAX_ATTEMPTS; attemptCount++ {//concurrency retry - /*solving parallel updates using an optimistic lock and retry, - this may result in a livelock; - however, random sleeps makes this possiblity nearly impossible*/ - err = transmitter.UpdateItem(packet) //try to update the item - //this may be overwritten by other test threads, in that case it will return a specific error - if errors.As(err,&ae){ //check if our call got overwritten - // item has changed - fmt.Println("Retrying...") - rand.Seed(time.Now().UnixNano()) - time.Sleep(time.Duration(rand.Intn(UPDATE_DELAY_THRESHOLD))*time.Second) - continue - } - fmt.Println("Update Completed") - break + err = transmitter.UpdateItem(packet) //try to update the item + //this may be overwritten by other test threads, in that case it will return a specific error + if err !=nil{ + return err } return err }