Skip to content

Commit

Permalink
Merge branch 'main' into add-optimizer-tiers
Browse files Browse the repository at this point in the history
  • Loading branch information
omerlavanet authored Sep 12, 2024
2 parents 30a7dce + 6ace409 commit cd1b3ef
Show file tree
Hide file tree
Showing 6 changed files with 34 additions and 14 deletions.
7 changes: 6 additions & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,9 @@ go.work.sum

Dockerfile
docker/docker-compose.*
cmd/**/Dockerfile
cmd/**/Dockerfile

.dockerignore
.gcloudignore

Makefile
4 changes: 3 additions & 1 deletion .github/workflows/lava.yml
Original file line number Diff line number Diff line change
Expand Up @@ -393,7 +393,6 @@ jobs:
contents: write
packages: write
id-token: write
needs: [test-consensus, test-protocol]
runs-on: ubuntu-latest
strategy:
matrix:
Expand Down Expand Up @@ -423,6 +422,9 @@ jobs:
uses: docker/build-push-action@v5
continue-on-error: true
with:
provenance: false
sbom: false
context: .
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
file: cmd/${{ matrix.binary }}/Dockerfile
Expand Down
7 changes: 4 additions & 3 deletions cmd/lavad/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,12 @@ RUN apk add --no-cache \

WORKDIR /lava

COPY go.mod go.sum ./

ENV GOCACHE=/root/.cache/go-build
RUN --mount=type=cache,target=/root/.cache/go-build \
--mount=type=cache,target=/root/go/pkg/mod \
go mod download
--mount=type=bind,source=go.sum,target=go.sum \
--mount=type=bind,source=go.mod,target=go.mod \
go mod download -x

COPY . .

Expand Down
5 changes: 4 additions & 1 deletion cmd/lavad/Dockerfile.Cosmovisor
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,12 @@ WORKDIR /lava

COPY go.mod go.sum ./

ENV GOCACHE=/root/.cache/go-build
RUN --mount=type=cache,target=/root/.cache/go-build \
--mount=type=cache,target=/root/go/pkg/mod \
go mod download
--mount=type=bind,source=go.sum,target=go.sum \
--mount=type=bind,source=go.mod,target=go.mod \
go mod download -x

COPY . .

Expand Down
9 changes: 5 additions & 4 deletions cmd/lavap/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,13 @@ RUN apk add --no-cache \

WORKDIR /lava

COPY go.mod go.sum ./

ENV GOCACHE=/root/.cache/go-build
RUN --mount=type=cache,target=/root/.cache/go-build \
--mount=type=cache,target=/root/go/pkg/mod \
go mod download

--mount=type=bind,source=go.sum,target=go.sum \
--mount=type=bind,source=go.mod,target=go.mod \
go mod download -x

COPY . .

ARG GIT_VERSION
Expand Down
16 changes: 12 additions & 4 deletions protocol/chainlib/provider_node_subscription_manager_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,7 @@ func TestSubscriptionManager_MultipleParallelSubscriptionsWithTheSameParamsAndNo
t.Run(play.name, func(t *testing.T) {
ts := SetupForTests(t, 1, play.specId, "../../")

wg := sync.WaitGroup{}
sentMessageToNodeChannel := make(chan bool, 1)
// msgCount := 0
upgrader := websocket.Upgrader{}
first := true
Expand Down Expand Up @@ -373,7 +373,12 @@ func TestSubscriptionManager_MultipleParallelSubscriptionsWithTheSameParamsAndNo
return
}
utils.LavaFormatDebug("write message")
wg.Done()
select {
case sentMessageToNodeChannel <- true:
utils.LavaFormatDebug("sent message to node")
default:
utils.LavaFormatDebug("unable to communicate with the test")
}

// Write the first reply
err = conn.WriteMessage(messageType, play.subscriptionFirstReply)
Expand Down Expand Up @@ -405,7 +410,6 @@ func TestSubscriptionManager_MultipleParallelSubscriptionsWithTheSameParamsAndNo
mockRpcProvider := &RelayFinalizationBlocksHandlerMock{}
pnsm := NewProviderNodeSubscriptionManager(chainRouter, chainParser, mockRpcProvider, ts.Providers[0].SK)

wg.Add(1)
wgAllIds := sync.WaitGroup{}
wgAllIds.Add(9)
errors := []error{}
Expand All @@ -429,7 +433,11 @@ func TestSubscriptionManager_MultipleParallelSubscriptionsWithTheSameParamsAndNo

utils.LavaFormatDebug("Waiting wait group")
wgAllIds.Wait()
wg.Wait() // Make sure the subscription manager sent a message to the node
select {
case <-sentMessageToNodeChannel: // Make sure the subscription manager sent a message to the node
case <-time.After(time.Second * 10):
require.Fail(t, "timeout waiting for message to node")
}
// make sure we had only one error, on the first subscription attempt
require.Len(t, errors, 1)

Expand Down

0 comments on commit cd1b3ef

Please sign in to comment.