From d145fbc559fe969c1db0889cfe59415bcd064830 Mon Sep 17 00:00:00 2001
From: Luca Moser <moser.luca@gmail.com>
Date: Tue, 16 Jun 2020 10:10:13 +0200
Subject: [PATCH] increases avg. network delay fcob rule, removes debug
 printlns

---
 plugins/webapi/value/gettransactionbyid/handler.go          | 4 ----
 plugins/webapi/value/sendtransaction/handler.go             | 6 ------
 .../tester/tests/consensus/consensus_conflicts_test.go      | 4 ++--
 tools/integration-tests/tester/tests/testutil.go            | 2 +-
 4 files changed, 3 insertions(+), 13 deletions(-)

diff --git a/plugins/webapi/value/gettransactionbyid/handler.go b/plugins/webapi/value/gettransactionbyid/handler.go
index 8e68d9ef..32a31570 100644
--- a/plugins/webapi/value/gettransactionbyid/handler.go
+++ b/plugins/webapi/value/gettransactionbyid/handler.go
@@ -1,7 +1,6 @@
 package gettransactionbyid
 
 import (
-	"log"
 	"net/http"
 
 	"github.com/iotaledger/goshimmer/dapps/valuetransfers"
@@ -14,7 +13,6 @@ import (
 func Handler(c echo.Context) error {
 	txnID, err := transaction.IDFromBase58(c.QueryParam("txnID"))
 	if err != nil {
-		log.Println(err)
 		return c.JSON(http.StatusBadRequest, Response{Error: err.Error()})
 	}
 
@@ -22,13 +20,11 @@ func Handler(c echo.Context) error {
 	cachedTxnMetaObj := valuetransfers.Tangle.TransactionMetadata(txnID)
 	defer cachedTxnMetaObj.Release()
 	if !cachedTxnMetaObj.Exists() {
-		log.Println("transaction meta doesn't exist for", txnID)
 		return c.JSON(http.StatusNotFound, Response{Error: "Transaction not found"})
 	}
 	cachedTxnObj := valuetransfers.Tangle.Transaction(txnID)
 	defer cachedTxnObj.Release()
 	if !cachedTxnObj.Exists() {
-		log.Println("transaction doesn't exist for", txnID)
 		return c.JSON(http.StatusNotFound, Response{Error: "Transaction not found"})
 	}
 	txn := utils.ParseTransaction(cachedTxnObj.Unwrap())
diff --git a/plugins/webapi/value/sendtransaction/handler.go b/plugins/webapi/value/sendtransaction/handler.go
index bbf8bd67..8a655715 100644
--- a/plugins/webapi/value/sendtransaction/handler.go
+++ b/plugins/webapi/value/sendtransaction/handler.go
@@ -1,7 +1,6 @@
 package sendtransaction
 
 import (
-	"log"
 	"net/http"
 
 	"github.com/iotaledger/goshimmer/dapps/valuetransfers"
@@ -14,26 +13,21 @@ import (
 func Handler(c echo.Context) error {
 	var request Request
 	if err := c.Bind(&request); err != nil {
-		log.Println(err.Error())
 		return c.JSON(http.StatusBadRequest, Response{Error: err.Error()})
 	}
 
 	// prepare transaction
 	tx, _, err := transaction.FromBytes(request.TransactionBytes)
 	if err != nil {
-		log.Println(err.Error())
 		return c.JSON(http.StatusBadRequest, Response{Error: err.Error()})
 	}
 
 	// Prepare value payload and send the message to tangle
 	payload := valuetransfers.ValueObjectFactory().IssueTransaction(tx)
-	log.Println("issued transaction")
 	_, err = issuer.IssuePayload(payload)
 	if err != nil {
-		log.Println(err.Error())
 		return c.JSON(http.StatusBadRequest, Response{Error: err.Error()})
 	}
-	log.Println("issued payload")
 
 	return c.JSON(http.StatusOK, Response{TransactionID: tx.ID().String()})
 }
diff --git a/tools/integration-tests/tester/tests/consensus/consensus_conflicts_test.go b/tools/integration-tests/tester/tests/consensus/consensus_conflicts_test.go
index 9d24e967..7c5b0379 100644
--- a/tools/integration-tests/tester/tests/consensus/consensus_conflicts_test.go
+++ b/tools/integration-tests/tester/tests/consensus/consensus_conflicts_test.go
@@ -24,7 +24,7 @@ import (
 func TestConsensusFiftyFiftyOpinionSplit(t *testing.T) {
 
 	// override avg. network delay to accustom integration test slowness
-	framework.ParaFCoBAverageNetworkDelay = 60
+	framework.ParaFCoBAverageNetworkDelay = 90
 	framework.ParaBootstrapOnEveryNode = true
 
 	// create two partitions with their own peers
@@ -150,7 +150,7 @@ func TestConsensusFiftyFiftyOpinionSplit(t *testing.T) {
 
 	// check that the transactions are marked as conflicting
 	tests.CheckTransactions(t, n.Peers(), expectations, true, tests.ExpectedInclusionState{
-		Finalized: tests.True(),
+		Finalized: tests.False(),
 		Conflict:  tests.True(),
 		Solid:     tests.True(),
 	})
diff --git a/tools/integration-tests/tester/tests/testutil.go b/tools/integration-tests/tester/tests/testutil.go
index 215c4438..594e60a7 100644
--- a/tools/integration-tests/tester/tests/testutil.go
+++ b/tools/integration-tests/tester/tests/testutil.go
@@ -469,7 +469,7 @@ func AwaitTransactionAvailability(peers []*framework.Peer, transactionIDs []stri
 	s := time.Now()
 	var missingMu sync.Mutex
 	missing = map[string]map[string]types.Empty{}
-	for ; time.Since(s) < maxAwait; time.Sleep(1 * time.Second) {
+	for ; time.Since(s) < maxAwait; time.Sleep(500 * time.Millisecond) {
 		var wg sync.WaitGroup
 		wg.Add(len(peers))
 		counter := int32(len(peers) * len(transactionIDs))
-- 
GitLab