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

tools\ci\tests\test_update_pr_preview.py fails on Windows #18255

Closed
gsnedders opened this issue Aug 2, 2019 · 0 comments
Closed

tools\ci\tests\test_update_pr_preview.py fails on Windows #18255

gsnedders opened this issue Aug 2, 2019 · 0 comments
Assignees

Comments

@gsnedders
Copy link
Contributor

@gsnedders gsnedders commented Aug 2, 2019

They're all similar to:

________________________ test_close_active_with_label _________________________

    def test_close_active_with_label():
        event_data = default_data('closed')
        event_data['pull_request']['closed_at'] = '2019-07-05'
        event_data['pull_request']['labels'].append(
            {'name': 'pull-request-has-preview'}
        )
    
>       returncode, requests = run(event_data)

ci\tests\test_update_pr_preview.py:181: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

event_data = {'action': 'closed', 'pull_request': {'closed_at': '2019-07-05', 'head': {'sha': 'deadbeef'}, 'labels': [{'name': 'foo'}, {'name': 'bar'}, {'name': 'pull-request-has-preview'}], 'number': 543, ...}}
responses = None

    def run(event_data, responses=None):
        event_data_file = tempfile.mkstemp()[1]
        env = {
            'GITHUB_EVENT_PATH': event_data_file,
            'GITHUB_REPOSITORY': 'test-org/test-repo'
        }
        env.update(os.environ)
        server = MockServer((test_host, 0), responses)
        test_port = server.server_address[1]
        threading.Thread(target=lambda: server.serve_forever()).start()
    
        try:
            with open(event_data_file, 'w') as handle:
                json.dump(event_data, handle)
    
            child = subprocess.Popen(
                ['python', subject, 'http://{}:{}'.format(test_host, test_port)],
                env=env
            )
    
            child.communicate()
        finally:
            server.shutdown()
>           os.remove(event_data_file)
E           PermissionError: [WinError 32] The process cannot access the file because it is being used by another process: 'C:\\Users\\VSSADM~1\\AppData\\Local\\Temp\\tmpy6thhvhr'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

3 participants
You can’t perform that action at this time.