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

better context handling + timeouts for QGB E2E network #459

Merged
merged 2 commits into from
Jun 9, 2022

Conversation

rach-id
Copy link
Member

@rach-id rach-id commented May 30, 2022

Closes #438

@rach-id rach-id self-assigned this May 30, 2022
@rach-id rach-id added the C: QGB label May 30, 2022
@@ -5,4 +5,4 @@ PACKAGES=$(shell go list ./...)
all: test

test:
@QGB_INTEGRATION_TEST=true go test -mod=readonly -test.timeout 30m -v $(PACKAGES)
@QGB_INTEGRATION_TEST=true go test -mod=readonly -failfast -test.timeout 30m -v $(PACKAGES)
Copy link
Member Author

Choose a reason for hiding this comment

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

I reintroduced this as it makes it easier to just everything when ctrl+c

@@ -86,6 +118,17 @@ func (network QGBNetwork) DeleteAll() error {
return nil
}

// KillAll kills all the containers.
func (network QGBNetwork) KillAll() error {
Copy link
Member Author

Choose a reason for hiding this comment

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

not currently used, but might be useful in the future

func (network QGBNetwork) WaitForNodeToStart(rpcAddr string) error {
timeoutChan := time.After(5 * time.Minute)
func (network QGBNetwork) WaitForNodeToStart(_ctx context.Context, rpcAddr string) error {
ctx, _ := context.WithTimeout(_ctx, 5*time.Minute) //nolint:govet
Copy link
Member Author

Choose a reason for hiding this comment

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

no need for a cancel function, we only need the timeout. If the happy path executes, then it will just return.

@rach-id rach-id requested a review from evan-forbes May 30, 2022 10:48
@codecov-commenter
Copy link

Codecov Report

Merging #459 (f5a5a9a) into qgb-integration (bfa7827) will decrease coverage by 0.05%.
The diff coverage is 0.00%.

@@                 Coverage Diff                 @@
##           qgb-integration     #459      +/-   ##
===================================================
- Coverage            11.44%   11.39%   -0.06%     
===================================================
  Files                   60       60              
  Lines                11518    11569      +51     
===================================================
  Hits                  1318     1318              
- Misses               10113    10164      +51     
  Partials                87       87              
Impacted Files Coverage Δ
e2e/qgb/qgb_network.go 0.00% <0.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 53c02f0...f5a5a9a. Read the comment docs.

Copy link
Member

@evan-forbes evan-forbes left a comment

Choose a reason for hiding this comment

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

iirc, the orignal comment was just to use context.Context as a timeout and not actually pass times to all of the functions. This way ctx.Done() combines both the timeout and the cancels. However I could definitely see this working too! I'm curious to hear more about what you had in mind, and we can discuss it in a sync sometime tmrw or whenever you have time

Copy link
Member

@evan-forbes evan-forbes left a comment

Choose a reason for hiding this comment

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

apologies for any delay with this

@rach-id rach-id merged commit 0e740d1 into celestiaorg:qgb-integration Jun 9, 2022
@rach-id rach-id deleted the timeout_qgb_e2e branch June 9, 2022 10:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Archived in project
Development

Successfully merging this pull request may close these issues.

None yet

3 participants