Skip to content

Commit

Permalink
chore: some fix for flaky tests (#1750)
Browse files Browse the repository at this point in the history
## Description:
some fix for flaky tests

## Is this change user facing?
NO

## References (if applicable):
More here:
https://www.notion.so/kurtosistech/Flaky-tests-analysis-094fef0f64be428c9cd32b49c1c94f9e
  • Loading branch information
leoporoli authored Nov 17, 2023
1 parent 161cd0e commit b558d38
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 16 deletions.
21 changes: 13 additions & 8 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ executors:
machine:
# This custom CircleCi Ubuntu image has a pre-installed Docker, so we are not using the CircleCI remote Docker when we
# initiate this machine. More here: https://discuss.circleci.com/t/linux-machine-executor-images-2022-january-q1-update/42831
image: ubuntu-2004:2023.07.1
image: ubuntu-2004:2023.10.1

parameters:
go-version:
Expand Down Expand Up @@ -513,7 +513,7 @@ jobs:
- when:
condition:
and:
- equal: [ "kubernetes", << parameters.cli-cluster-backend >> ]
- equal: [ "kubernetes", << parameters.cli-cluster-backend >> ]
<<: *steps_prepare_testing_k8s_k3s

- when:
Expand Down Expand Up @@ -790,13 +790,18 @@ jobs:
# Execute port print
- run: "${KURTOSIS_BINPATH} port print test-datastore datastore-0 grpc"

# Execute docker compose import
- run: "${KURTOSIS_BINPATH} import --enclave test-import --env << pipeline.parameters.dockerimport-cli-dotenv-relative-path >> << pipeline.parameters.dockerimport-cli-dockerfile-relative-path >>"

# Stop test-datastore enclave
- run: "${KURTOSIS_BINPATH} enclave stop test-datastore"

# Ensure we can still inspect stopped enclaves
- run: "${KURTOSIS_BINPATH} enclave stop test-enclave"
- run: "${KURTOSIS_BINPATH} enclave stop test-datastore"
- run: "${KURTOSIS_BINPATH} enclave inspect test-enclave" # Ensure we can still inspect stopped enclaves
- run: "${KURTOSIS_BINPATH} enclave inspect test-enclave"

# Clean all before compose import to free resources
- run: "${KURTOSIS_BINPATH} clean -a"

# Execute docker compose import
- run: "${KURTOSIS_BINPATH} import --enclave test-import --env << pipeline.parameters.dockerimport-cli-dotenv-relative-path >> << pipeline.parameters.dockerimport-cli-dockerfile-relative-path >>"

# Execute engine functions
- run: "${KURTOSIS_BINPATH} engine stop"
Expand Down Expand Up @@ -824,7 +829,7 @@ jobs:
docker container restart $(echo $apic_container_id)
${KURTOSIS_BINPATH} service rm test-apic-restart service-test
# Test APIC idempotent runs restart
# Test APIC idempotent runs restart
- when:
condition:
equal: [ "docker", << parameters.cli-cluster-backend >> ]
Expand Down
2 changes: 1 addition & 1 deletion cli/cli/commands/service/add/add.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ const (

portMappingSeparatorForLogs = ", "

defaultPortWaitTimeoutStr = "15s"
defaultPortWaitTimeoutStr = "30s"
)

var (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@ def run(plan):
)

func TestIdentifiers(t *testing.T) {
// TODO remove this call after 17-11-2023
test_helpers.SkipFlakyTest(t, testName)

ctx := context.Background()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ func (suite *StartosisAddServiceTestSuite) TestAddServiceWithInvalidServiceNameF
runResult, _ := suite.RunScript(ctx, fmt.Sprintf(addServiceInvalidServiceNameTestScript, invalidServiceName))

t := suite.T()

require.NotNil(t, runResult)
require.Nil(t, runResult.InterpretationError, "Unexpected interpretation error.")
require.NotEmpty(t, runResult.ValidationErrors, "Expected some validation errors")
require.Contains(t, runResult.ValidationErrors[0].ErrorMessage, fmt.Sprintf("Service name '%v' is invalid as it contains disallowed characters. Service names must adhere to the RFC 1035 standard, specifically implementing this regex and be 1-63 characters long: ^[a-z]([-a-z0-9]{0,61}[a-z0-9])?$. This means the service name must only contain lowercase alphanumeric characters or '-', and must start with a lowercase alphabet and end with a lowercase alphanumeric character.", invalidServiceName))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ func (suite *StartosisPackageTestSuite) TestStartosisNoMainBranchRemotePackage_R
runResult, _ := suite.RunRemotePackage(ctx, noMainBranchWithRelativeImportRemotePackage)

t := suite.T()
require.NotNil(t, runResult)
require.Nil(t, runResult.InterpretationError)
require.Empty(t, runResult.ValidationErrors)
require.Nil(t, runResult.ExecutionError)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,6 @@ def run(plan):
)

func TestAddServiceAndPersistentFileToDirectory(t *testing.T) {
// TODO remove this call after 17-11-2023
test_helpers.SkipFlakyTest(t, testName)

ctx := context.Background()
// ------------------------------------- ENGINE SETUP ----------------------------------------------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,6 @@ type serviceLogsRequestInfoAndExpectedResults struct {
}

func TestStreamLogs(t *testing.T) {
// TODO remove this call after 17-11-2023
test_helpers.SkipFlakyTest(t, testName)

ctx := context.Background()

Expand Down

0 comments on commit b558d38

Please sign in to comment.