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

Occasionally got PermissionError when build starts #331

Open
Gatorix opened this issue Aug 18, 2023 · 0 comments
Open

Occasionally got PermissionError when build starts #331

Gatorix opened this issue Aug 18, 2023 · 0 comments
Labels

Comments

@Gatorix
Copy link

Gatorix commented Aug 18, 2023

Jenkins and plugins versions report

Environment

the script doesn't work

Jenkins 2.361.4
Allure Jenkins Plugin 2.30.3

What Operating System are you using (both controller, and any agents involved in the problem)?

win service 2008

Reproduction steps

I just have one computer to run the web UI tests, when i build continuous(like 10 times using different parameters), occasionally when build starts, the jenkins console give me the PermissionError and says couldn't delete the allure-dir,because some other program using it.

Here's my pytest params:
pytest.main(
[f'-m {run_marks}',
'--clean-alluredir',
'--alluredir', allure_dir,
'-n', multiprocess,
'--reruns', reruns,
'--reruns-delay', reruns_delay,
'--dashboard']
)

Expected Results

continuous build in jenkins success

Actual Results

got PermissionError

Anything else?

when the testcases finished, jenkins allure-plugin start to generate allure report, but when the report finished, occasionally allure-dir folder is still in use, at the same time next build starts, and the pytest params has "--clean-alluredir".
i guess this is the reason, so i add following code:

try:
    shutil.rmtree(allure_dir)
except PermissionError:
    time.sleep(5)

when build starts, try to remove allure-dir first, if got PermissionError, force wait 5 second, but this seems doesn't work.

could anyone help me.

@Gatorix Gatorix added the bug label Aug 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant