Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changes to support E2E tests with confirmations, where requests might be slow #960

Merged
merged 2 commits into from
Aug 11, 2022

Conversation

peterbroadhurst
Copy link
Contributor

Biggest change is to the HTTP Server to allow requests longer than 15s to complete without the client getting an EOF.

See hyperledger/firefly-common#31

… be longer

Signed-off-by: Peter Broadhurst <peter.broadhurst@kaleido.io>
Signed-off-by: Peter Broadhurst <peter.broadhurst@kaleido.io>
github.com/hyperledger/firefly-common v0.1.19-0.20220811200324-b6c4c44d2d0d h1:9s1MI4RIfKgftrGQ6sI2gvQBEQElq2CQOs3uaiB44s8=
github.com/hyperledger/firefly-common v0.1.19-0.20220811200324-b6c4c44d2d0d/go.mod h1:MNbaI2spBsdZYOub6Duj9xueE7Qyu9itOmJ4vE8tjYw=
github.com/hyperledger/firefly-common v0.1.20 h1:0dShkjlIShyBxkXRmu3vLmpEK6xrqmfc8GhF6k0Vgbg=
github.com/hyperledger/firefly-common v0.1.20/go.mod h1:gMlv4Iy5JjnzXmSEdb+tWVDIc/2GhL9MRcgNX+VmI4M=
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't understand go.sum but why are there so many firefly-common entries??

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was testing along the way - it seems to just add in each one you use, and never remove it

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

e.g. I was doing go get github.com/hyperledger/firefly-common@b6c4c44d2d0dc4b1c511aab629facf67113e3708 from branches in common, to test my changes

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

go mod tidy?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Decision: Will do this in next PR, to keep the pipeline moving as this is way into the E2Es

if _, isReader := req.Body.(io.Reader); !isReader {
b, _ = json.Marshal(req.Body)
}
l.Logf("%s: ==> %s %s %s: %s", fftypes.Now(), req.Method, req.URL, req.QueryParam, string(b))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Feels a little odd that we add timestamps inside these logs (shouldn't that be a higher-level job delegated to the logging framework for all logs?)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, but I couldn't find an option in the Go test framework to make t.Logf add timestamps... so this is a workaround that didn't mean changing every log line

@@ -223,7 +223,7 @@ func checkObject(t *testing.T, expected interface{}, actual interface{}) bool {
}

func VerifyAllOperationsSucceeded(t *testing.T, clients []*client.FireFlyClient, startTime time.Time) {
tries := 3
tries := 30
delay := 2 * time.Second
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

60 seconds seems quite long

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm happy to reduce - I think I need 30seconds with 2 confirmations, obviously more with more confirmations

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, if we're sure 30 seconds is "happy path" in this world, 60 seems reasonable. It does make the suite take quite a long time then, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Decision: Leave at 60 for now

Copy link
Contributor

@awrichar awrichar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left a few questions, but overall it seems OK

@peterbroadhurst peterbroadhurst merged commit d7597a8 into hyperledger:main Aug 11, 2022
@peterbroadhurst peterbroadhurst deleted the confirmations branch August 11, 2022 21:09
@awrichar awrichar mentioned this pull request Aug 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants