mirror of
https://github.com/cp2k/cp2k.git
synced 2026-07-21 06:25:15 -04:00
Add timeout flag and allow for flags using make_pretty.sh
Using "make_pretty.sh -j 1 -t 2" is often more likely to work than increasing the (hardwired) timeout value
This commit is contained in:
parent
70b5527ee6
commit
4180bf53f7
2 changed files with 12 additions and 3 deletions
|
|
@ -2,6 +2,6 @@
|
||||||
|
|
||||||
CP2K_ROOT=$(dirname "$0")
|
CP2K_ROOT=$(dirname "$0")
|
||||||
|
|
||||||
"${CP2K_ROOT}/tools/precommit/precommit.py" --allow-modifications
|
"${CP2K_ROOT}/tools/precommit/precommit.py" --allow-modifications "$@"
|
||||||
|
|
||||||
#EOF
|
#EOF
|
||||||
|
|
|
||||||
|
|
@ -59,13 +59,22 @@ def main() -> None:
|
||||||
default=1,
|
default=1,
|
||||||
help="number seconds in between progressbar updates",
|
help="number seconds in between progressbar updates",
|
||||||
)
|
)
|
||||||
|
parser.add_argument(
|
||||||
|
"-t",
|
||||||
|
"--timeout",
|
||||||
|
type=int,
|
||||||
|
default=10,
|
||||||
|
help="Server wait timeout in seconds",
|
||||||
|
)
|
||||||
parser.add_argument("files", metavar="FILE", nargs="*", help="files to process")
|
parser.add_argument("files", metavar="FILE", nargs="*", help="files to process")
|
||||||
args = parser.parse_args()
|
args = parser.parse_args()
|
||||||
|
|
||||||
print( # Say hello to the server.
|
print( # Say hello to the server.
|
||||||
f"Running precommit checks using {args.num_workers} workers and server: {SERVER}"
|
f"Running precommit checks using {args.num_workers} workers and server: {SERVER} (server wait timeout: {args.timeout} seconds)"
|
||||||
|
)
|
||||||
|
server_hello = (
|
||||||
|
urlopen(Request(SERVER + "/"), timeout=args.timeout).read().decode("utf8")
|
||||||
)
|
)
|
||||||
server_hello = urlopen(Request(SERVER + "/"), timeout=10).read().decode("utf8")
|
|
||||||
assert server_hello.startswith("cp2k precommit server")
|
assert server_hello.startswith("cp2k precommit server")
|
||||||
|
|
||||||
# Store candidate before changing base directory and creating scratch dir.
|
# Store candidate before changing base directory and creating scratch dir.
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue