Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix TestClientOnResponseError parallel tests #710

Merged
merged 1 commit into from Sep 25, 2023

Commits on Sep 25, 2023

  1. fix TestClientOnResponseError parallel tests

    In case of using `t.Parallel()` inside a for loop, the loop variables must be copied, otherwise only the last test will be executed.
    
    ```go
    	for _, test := range tests {
    		t.Run(test.name, func(t *testing.T) {
    			t.Parallel()
    ```
    changed to
    ```go
    	for _, test := range tests {
    		test := test
    		t.Run(test.name, func(t *testing.T) {
    			t.Parallel()
    ```
    
    also the AuthServer must be created within the test, otherwise some tests fail.
    
    `t.Log(test.Name)` can be used to verify the issue:
    ```go
    	for _, test := range tests {
    		t.Run(test.name, func(t *testing.T) {
    			t.Parallel()
    			t.Log("Test name:", test.name)
    ```
    SVilgelm committed Sep 25, 2023
    Configuration menu
    Copy the full SHA
    b6a0e29 View commit details
    Browse the repository at this point in the history