diff --git a/test/e2e/e2e.go b/test/e2e/e2e.go index c96928aefd..41cfe1658c 100644 --- a/test/e2e/e2e.go +++ b/test/e2e/e2e.go @@ -138,7 +138,7 @@ func WaitForEvent(t *testing.T, c chan *core.EventDelivery, eventType core.Event t.Logf("Detected '%s' event for ref '%s'", ed.Type, ed.Reference) return } - t.Logf("Ignored event '%s'", ed.ID) + t.Logf("Ignored event '%s' [%s]", ed.ID, ed.Type) } } @@ -149,7 +149,7 @@ func WaitForMessageConfirmed(t *testing.T, c chan *core.EventDelivery, msgType c t.Logf("Detected '%s' event for message '%s' of type '%s'", ed.Type, ed.Message.Header.ID, msgType) return ed } - t.Logf("Ignored event '%s'", ed.ID) + t.Logf("Ignored event '%s' [%s]", ed.ID, ed.Type) } } @@ -160,7 +160,7 @@ func WaitForMessageRejected(t *testing.T, c chan *core.EventDelivery, msgType co t.Logf("Detected '%s' event for message '%s' of type '%s'", ed.Type, ed.Message.Header.ID, msgType) return ed } - t.Logf("Ignored event '%s'", ed.ID) + t.Logf("Ignored event '%s' [%s]", ed.ID, ed.Type) } } @@ -171,7 +171,7 @@ func WaitForIdentityConfirmed(t *testing.T, c chan *core.EventDelivery) *core.Ev t.Logf("Detected '%s' event for identity '%s'", ed.Type, ed.Reference) return ed } - t.Logf("Ignored event '%s'", ed.ID) + t.Logf("Ignored event '%s' [%s]", ed.ID, ed.Type) } } diff --git a/test/e2e/multiparty/contract_migration.go b/test/e2e/multiparty/contract_migration.go index b398a76aa7..e9ec6ae0e9 100644 --- a/test/e2e/multiparty/contract_migration.go +++ b/test/e2e/multiparty/contract_migration.go @@ -19,7 +19,6 @@ package multiparty import ( "fmt" "strings" - "time" "github.com/hyperledger/firefly-common/pkg/fftypes" "github.com/hyperledger/firefly/pkg/core" @@ -109,7 +108,7 @@ func runMigrationTest(suite *ContractMigrationTestSuite, address1, address2 stri e2e.PollForUp(suite.T(), client1) e2e.PollForUp(suite.T(), client2) - eventNames := "message_confirmed|blockchain_event_received" + eventNames := "message_confirmed|blockchain_event_received|identity_confirmed" queryString := fmt.Sprintf("namespace=%s&ephemeral&autoack&filter.events=%s", testNamespace, eventNames) received1 := e2e.WsReader(client1.WebSocket(suite.T(), queryString, nil)) received2 := e2e.WsReader(client2.WebSocket(suite.T(), queryString, nil)) @@ -151,11 +150,12 @@ func runMigrationTest(suite *ContractMigrationTestSuite, address1, address2 stri client2.RegisterSelfNode(suite.T(), true) // Wait for the orgs to propagate (org2 to node1, and org1 to node 2) - for client1.GetOrganization(suite.T(), suite.testState.org2.Name) == nil { - time.Sleep(100 * time.Millisecond) - } - for client2.GetOrganization(suite.T(), suite.testState.org1.Name) == nil { - time.Sleep(100 * time.Millisecond) + orgConfs := append([]*core.EventDelivery{}, e2e.WaitForIdentityConfirmed(suite.T(), received1)) + orgConfs = append(orgConfs, e2e.WaitForIdentityConfirmed(suite.T(), received1)) + orgConfs = append(orgConfs, e2e.WaitForIdentityConfirmed(suite.T(), received2)) + orgConfs = append(orgConfs, e2e.WaitForIdentityConfirmed(suite.T(), received2)) + for _, oc := range orgConfs { + assert.Regexp(suite.T(), fmt.Sprintf("%s|%s", suite.testState.org1.Name, suite.testState.org2.Name), oc.Identity.DID) } // Migrate to the new contract