Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(172)

Side by Side Diff: tools/test.py

Issue 6660020: [Isolates] Make test.py ignore occasional Windows unlink() failures (Closed) Base URL: http://v8.googlecode.com/svn/branches/experimental/isolates/
Patch Set: Created 9 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/env python 1 #!/usr/bin/env python
2 # 2 #
3 # Copyright 2008 the V8 project authors. All rights reserved. 3 # Copyright 2008 the V8 project authors. All rights reserved.
4 # Redistribution and use in source and binary forms, with or without 4 # Redistribution and use in source and binary forms, with or without
5 # modification, are permitted provided that the following conditions are 5 # modification, are permitted provided that the following conditions are
6 # met: 6 # met:
7 # 7 #
8 # * Redistributions of source code must retain the above copyright 8 # * Redistributions of source code must retain the above copyright
9 # notice, this list of conditions and the following disclaimer. 9 # notice, this list of conditions and the following disclaimer.
10 # * Redistributions in binary form must reproduce the above 10 # * Redistributions in binary form must reproduce the above
(...skipping 484 matching lines...) Expand 10 before | Expand all | Expand 10 after
495 sleep_time = MAX_SLEEP_TIME 495 sleep_time = MAX_SLEEP_TIME
496 return (process, exit_code, timed_out) 496 return (process, exit_code, timed_out)
497 497
498 498
499 def PrintError(str): 499 def PrintError(str):
500 sys.stderr.write(str) 500 sys.stderr.write(str)
501 sys.stderr.write('\n') 501 sys.stderr.write('\n')
502 502
503 503
504 def CheckedUnlink(name): 504 def CheckedUnlink(name):
505 try: 505 # On Windows, when run with -jN in parallel processes,
506 os.unlink(name) 506 # OS often fails to unlink the temp file. Not sure why.
507 except OSError, e: 507 # Need to retry.
508 PrintError("os.unlink() " + str(e)) 508 # Idea from https://bugs.webkit.org/attachment.cgi?id=75982&action=prettypatch
509 509 retry_count = 0
510 while retry_count < 30:
511 try:
512 os.unlink(name)
513 return
514 except OSError, e:
515 retry_count += 1;
516 time.sleep(retry_count * 0.1)
517 PrintError("os.unlink() " + str(e))
510 518
511 def Execute(args, context, timeout=None): 519 def Execute(args, context, timeout=None):
512 (fd_out, outname) = tempfile.mkstemp() 520 (fd_out, outname) = tempfile.mkstemp()
513 (fd_err, errname) = tempfile.mkstemp() 521 (fd_err, errname) = tempfile.mkstemp()
514 (process, exit_code, timed_out) = RunProcess( 522 (process, exit_code, timed_out) = RunProcess(
515 context, 523 context,
516 timeout, 524 timeout,
517 args = args, 525 args = args,
518 stdout = fd_out, 526 stdout = fd_out,
519 stderr = fd_err, 527 stderr = fd_err,
(...skipping 947 matching lines...) Expand 10 before | Expand all | Expand 10 after
1467 for entry in timed_tests[:20]: 1475 for entry in timed_tests[:20]:
1468 t = FormatTime(entry.duration) 1476 t = FormatTime(entry.duration)
1469 sys.stderr.write("%4i (%s) %s\n" % (index, t, entry.GetLabel())) 1477 sys.stderr.write("%4i (%s) %s\n" % (index, t, entry.GetLabel()))
1470 index += 1 1478 index += 1
1471 1479
1472 return result 1480 return result
1473 1481
1474 1482
1475 if __name__ == '__main__': 1483 if __name__ == '__main__':
1476 sys.exit(Main()) 1484 sys.exit(Main())
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698