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

testutil/compose: handle docker-compose build seperately #1466

Merged
merged 5 commits into from
Nov 21, 2022

Conversation

dB2510
Copy link
Contributor

@dB2510 dB2510 commented Nov 21, 2022

Handle docker-compose build command separately before starting alerts collector. This step takes longer at first and takes almost no time to build again. This might be the reason why default_alpha test in smoke tests seldom completes. Also increased alert timeout for very_large test.

category: test
ticket: #992

for ctx.Err() == nil {
time.Sleep(time.Second * 5)
time.Sleep(time.Second * 2)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

this will wait for 10 seconds first to let prometheus container to start and then poll alerts every 2 seconds

@@ -125,6 +125,11 @@ func Auto(ctx context.Context, conf AutoConfig) error {
defer cancel()
}

// Build docker-compose services before executing docker-compose up.
if err = execBuild(ctx, conf.Dir); err != nil {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Found out from logs that this steps longer for the first test which is included in alerts timeout

@codecov
Copy link

codecov bot commented Nov 21, 2022

Codecov Report

Base: 53.74% // Head: 53.97% // Increases project coverage by +0.23% 🎉

Coverage data is based on head (a5546e6) compared to base (35621f4).
Patch coverage: 13.33% of modified lines in pull request are covered.

❗ Current head a5546e6 differs from pull request most recent head 56f8f15. Consider uploading reports for the commit 56f8f15 to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1466      +/-   ##
==========================================
+ Coverage   53.74%   53.97%   +0.23%     
==========================================
  Files         147      147              
  Lines       18684    18702      +18     
==========================================
+ Hits        10042    10095      +53     
+ Misses       7266     7231      -35     
  Partials     1376     1376              
Impacted Files Coverage Δ
testutil/compose/alert.go 0.00% <0.00%> (ø)
testutil/compose/auto.go 0.00% <0.00%> (ø)
testutil/compose/run.go 82.14% <57.14%> (-3.05%) ⬇️
app/vmock.go 74.09% <0.00%> (+2.59%) ⬆️
core/qbft/qbft.go 82.46% <0.00%> (+10.02%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@@ -149,8 +154,7 @@ func Auto(ctx context.Context, conf AutoConfig) error {
}
}
if !alertSuccess {
log.Error(ctx, "Alerts couldn't be polled", nil)
return nil // TODO(corver): Fix this and error
return errors.New("alerts couldn't be polled, containers offline")
Copy link
Contributor

Choose a reason for hiding this comment

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

containers offline isn't correct. Sure it might be the most common reason, but it isn't the only reason.

@@ -59,26 +60,30 @@ func TestSmoke(t *testing.T) {
conf.KeyGen = compose.KeyGenCreate
conf.FeatureSet = "alpha"
},
Timeout: time.Second * 45,
Copy link
Contributor

Choose a reason for hiding this comment

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

suggest using a defaultTimeout variable if Timeout is empty

for ctx.Err() == nil {
time.Sleep(time.Second * 5)
time.Sleep(time.Second * 2)
Copy link
Contributor

Choose a reason for hiding this comment

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

rather sleep at the end of the loop (so you check for context closed directly after sleeping instead of doing logic with a possible cancelled context)

@dB2510 dB2510 added the merge when ready Indicates bulldozer bot may merge when all checks pass label Nov 21, 2022
@obol-bulldozer obol-bulldozer bot merged commit 47f7bd9 into main Nov 21, 2022
@obol-bulldozer obol-bulldozer bot deleted the dhruv/compose branch November 21, 2022 16:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merge when ready Indicates bulldozer bot may merge when all checks pass
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants