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 #7142: Change manifest update process #9564

Merged
merged 1 commit into from Feb 19, 2018

Conversation

Projects
None yet
4 participants
@vedantc98
Copy link
Contributor

vedantc98 commented Feb 17, 2018

Earlier, interrupting the manifest-update could end up
causing errors due to the non-atomicity of the process.
Use tempfile to ensure that the file is written correctly.


This change is Reviewable

@wpt-pr-bot wpt-pr-bot added the infra label Feb 17, 2018

@wpt-pr-bot wpt-pr-bot requested review from gsnedders and jgraham Feb 17, 2018

@vedantc98 vedantc98 force-pushed the vedantc98:manifest_update branch from 794d95c to 4a5f28e Feb 17, 2018

@w3c-bots

This comment has been minimized.

Copy link

w3c-bots commented Feb 17, 2018

Build PASSED

Started: 2018-02-18 09:57:05
Finished: 2018-02-18 10:11:04

View more information about this build on:

@jgraham
Copy link
Contributor

jgraham left a comment

This generally looks good, thanks! Just a minor change before we can land it.

@@ -229,9 +229,14 @@ def load(tests_root, manifest):


def write(manifest, manifest_path):
from tempfile import NamedTemporaryFile

This comment has been minimized.

Copy link
@jgraham

jgraham Feb 18, 2018

Contributor

Move this import to the top of the file.

json.dump(manifest.to_json(), f, sort_keys=True, indent=1, separators=(',', ': '))
f.write("\n")

temp_manifest = NamedTemporaryFile(mode="wb", dir=dir_name)

This comment has been minimized.

Copy link
@jgraham

jgraham Feb 18, 2018

Contributor

I think we should actually use mkstemp directly since the semantcs of NamedTemporaryFile are to delete the file, which isn't going to work in this case since it's renamed.

This comment has been minimized.

Copy link
@vedantc98

vedantc98 Feb 18, 2018

Author Contributor

Yes it does give a silent warning when it attempts to delete the file with NamedTemporaryFile, so I'll change that.

@vedantc98 vedantc98 force-pushed the vedantc98:manifest_update branch from 4a5f28e to ccb4fda Feb 18, 2018

Fix #7142: Change manifest update process
Earlier, interrupting the manifest-update could end up
causing errors due to the non-atomicity of the process.
Used tempfile to ensure that the file is written correctly.

@vedantc98 vedantc98 force-pushed the vedantc98:manifest_update branch from ccb4fda to 31d5d78 Feb 18, 2018

@jgraham jgraham merged commit 3861216 into web-platform-tests:master Feb 19, 2018

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details

@vedantc98 vedantc98 deleted the vedantc98:manifest_update branch Feb 19, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.