Skip to content

Commit

Permalink
Add comment for cosmosdb.go tests (#8477)
Browse files Browse the repository at this point in the history
* Add comment for cosmosdb.go tests

* Skip test for mac users

* Revert "Skip test for mac users"

This reverts commit b1309f5.

* Update comment

* Revive macOS skip
  • Loading branch information
itaigilo authored Jan 9, 2025
1 parent b2b1714 commit b46e8da
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
10 changes: 10 additions & 0 deletions pkg/kv/cosmosdb/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"log"
"net/http"
"os"
"runtime"
"testing"
"time"

Expand All @@ -26,6 +27,10 @@ var (

func TestCosmosDB(t *testing.T) {
kvtest.DriverTest(t, func(t testing.TB, ctx context.Context) kv.Store {
if runtime.GOOS == "darwin" {
t.Skipf("this test hangs for macOS users, and fails. skipping - see Issue#8476 for more details")
}

t.Helper()

databaseClient, err := client.NewDatabase(testParams.Database)
Expand Down Expand Up @@ -56,6 +61,11 @@ func TestCosmosDB(t *testing.T) {
}

func TestMain(m *testing.M) {
if runtime.GOOS == "darwin" {
// this part hangs for macOS users, and fails. skipping - see Issue#8476 for more details
return
}

databaseURI, cleanupFunc, err := testutil.GetCosmosDBInstance()
if err != nil {
log.Fatalf("Could not connect to Docker: %s", err)
Expand Down
1 change: 1 addition & 0 deletions pkg/testutil/cosmosdb.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ func GetCosmosDBInstance() (string, func(), error) {

dockerPool.MaxWait = maxWait
log.Printf("Waiting up to %v for emulator to start", dockerPool.MaxWait)
// Note: this hangs for macOS users, and fails. See https://github.com/treeverse/lakeFS/issues/8476
err = dockerPool.Retry(func() error {
// waiting for cosmosdb container to be ready by issuing an HTTP get request with
// exponential backoff retry. The response is not really meaningful for that case
Expand Down

0 comments on commit b46e8da

Please sign in to comment.