From 1a72d848bf1217e82466b7783397517d288b650e Mon Sep 17 00:00:00 2001 From: hoangdv2429 Date: Mon, 25 Mar 2024 12:47:50 +0700 Subject: [PATCH] contemporary --- .github/workflows/lint.yml | 54 -------------------------------------- block/manager_test.go | 15 +++++------ 2 files changed, 6 insertions(+), 63 deletions(-) delete mode 100644 .github/workflows/lint.yml diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml deleted file mode 100644 index c475dce94..000000000 --- a/.github/workflows/lint.yml +++ /dev/null @@ -1,54 +0,0 @@ -name: golangci-lint -on: - push: - tags: - - v* - branches: - - "main" - pull_request: - -jobs: - golangci: - name: lint - runs-on: ubuntu-latest - env: - GOPRIVATE: "github.com/dymensionxyz/*" - GH_ACCESS_TOKEN: "${{ secrets.GH_ACCESS_TOKEN }}" - steps: - - uses: actions/checkout@v4 - - uses: actions/setup-go@v5 - with: - go-version: "1.22" - - name: golangci-lint - uses: golangci/golangci-lint-action@v4.0.0 - with: - # Optional: version of golangci-lint to use in form of v1.2 or v1.2.3 or `latest` to use the latest version - version: v1.56.2 - skip-cache: true - - # Optional: working directory, useful for monorepos - # working-directory: somedir - - # Optional: golangci-lint command line arguments. - # args: --issues-exit-code=0 - - # Optional: show only new issues if it's a pull request. The default value is `false`. - # only-new-issues: true - - # Optional: if set to true then the action will use pre-installed Go. - # skip-go-installation: true - - # Optional: if set to true then the action don't cache or restore ~/go/pkg. - # skip-pkg-cache: true - - # Optional: if set to true then the action don't cache or restore ~/.cache/go-build. - # skip-build-cache: true - markdownlint: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - name: markdownlint-cli - uses: nosborn/github-action-markdown-cli@v3.3.0 - with: - files: . - config-file: .markdownlint.yaml diff --git a/block/manager_test.go b/block/manager_test.go index 3c2b1697f..321de8506 100644 --- a/block/manager_test.go +++ b/block/manager_test.go @@ -144,16 +144,12 @@ func TestProduceOnlyAfterSynced(t *testing.T) { // Capture the error returned by manager.Start. errChan := make(chan error, 1) go func() { - errChan <- manager.Start(ctx, true) // Assuming manager.Start is modified to return an error. - }() - - select { - case <-ctx.Done(): - // Context completed. - case err := <-errChan: + errChan <- manager.Start(ctx, true) + err := <-errChan // Check for error from manager.Start. assert.NoError(t, err, "Manager start should not produce an error") - } + }() + <-ctx.Done() assert.True(t, manager.syncTarget == batch.EndHeight) //validate that we produced blocks assert.Greater(t, manager.store.Height(), batch.EndHeight) @@ -435,7 +431,8 @@ func TestCreateNextDABatchWithBytesLimit(t *testing.T) { t.Run(tc.name, func(t *testing.T) { // Produce blocks for i := 0; i < tc.blocksToProduce; i++ { - _ = manager.produceBlock(ctx, true) + err := manager.produceBlock(ctx, true) + assert.NoError(err) } // Call createNextDABatch function