Skip to content

Flake?: TestSSHAuthSockPathHandling #8571

Closed

Description

@vito

Seeing this test fail in #8442 but it doesn't seem related.

Example:

Error: module at source dir "" doesn't exist or is invalid

Looks like this test was added in #8365

cc @grouville

Activity

  1. self-assigned this
    on Sep 25, 2024
  2. grouville commented on Sep 25, 2024

    @grouville
    Member

    Probably a flake, I've been tracking another one last week 🙏 Hope it's not blocking the PR. Taking a look 👀

  3. grouville commented on Sep 25, 2024

    @grouville
    Member

    Potentially related to #8385. But the fact that all commits since cb42521 got merged fail is suspicious 👀

  4. grouville commented on Sep 25, 2024

    @grouville
    Member

    Confirming flake, keeping a look at it

  5. grouville commented on Sep 25, 2024

    @grouville
    Member

    Found the fix, unsure about the implications @vito

    When running this script, we can basically get the flake right away, in less than 10 iterations:

    #!/bin/bash
    
    log_file="test_results.log"
    max_iterations=10
    
    echo "Starting test loop. Results will be logged to $log_file" | tee -a "$log_file"
    
    for i in $(seq 1 $max_iterations); do
        echo "Iteration $i of $max_iterations" | tee -a "$log_file"
        echo "----------------------------------------" | tee -a "$log_file"
        
        go test -race -count=1 ./core/integration -run "TestModule/TestSSHAuthSockPathHandling" -v
        
        exit_code=${PIPESTATUS[0]}
        echo "Exit code: $exit_code" | tee -a "$log_file"
        echo "----------------------------------------" | tee -a "$log_file"
        
        if [ $exit_code -ne 0 ]; then
            echo "Test failed with exit code $exit_code. Stopping the loop." | tee -a "$log_file"
            exit $exit_code
        fi
        
        echo "" | tee -a "$log_file"
    done
    
    echo "All iterations completed successfully." | tee -a "$log_file"

    After a few iterations / isolations on my side, it seems that the root cause is the fact that the tests do run in parallel from the SAME client. Moving the client inside each of the test running in parallel does remove the flake:

    func (ModuleSuite) TestSSHAuthSockPathHandling(ctx context.Context, t *testctx.T) {
    	repoURL := "[email protected]:dagger-modules/private/test/more/dagger-test-modules-private.git"
    
    	t.Run("SSH auth with home expansion and symlink", func(ctx context.Context, t *testctx.T) {
    		c := connect(ctx, t)
    		mountedSocket, cleanup := mountedPrivateRepoSocket(c, t)
    		defer cleanup()
    })
    
    	t.Run("SSH auth from different relative paths", func(ctx context.Context, t *testctx.T) {
    		c := connect(ctx, t)
    		mountedSocket, cleanup := mountedPrivateRepoSocket(c, t)
    		defer cleanup()
    })

    A bit confused on the implications of that statement

    Ok, this behavior is a bit surprising and a bit confusing: in a nested environment, to have full isolation across parallel tests, it is better to have a client per test ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions