Public Access
Complete 26.3 parity acceptance and dual-version release workflow
Build and smoke / changes (push) Waiting to run
Build and smoke / changes (push) Waiting to run
This commit is contained in:
1 parent
41daff1e61
commit
4a59fb5d02
26 files changed
+1241
-369
No files matched your search
@@ -0,0 +1,18 @@
|
||||
"""One managed temporary Minecraft server at a time on this host."""
|
||||
from contextlib import contextmanager
|
||||
import fcntl
|
||||
from pathlib import Path
|
||||
import tempfile
|
||||
|
||||
|
||||
@contextmanager
|
||||
def server_test_lock():
|
||||
with (Path(tempfile.gettempdir()) / "rivencraft-server-tests.lock").open("a") as lock:
|
||||
try:
|
||||
fcntl.flock(lock, fcntl.LOCK_EX | fcntl.LOCK_NB)
|
||||
except BlockingIOError:
|
||||
raise SystemExit("Another Rivencraft server test is active; finish it before starting this one")
|
||||
try:
|
||||
yield
|
||||
finally:
|
||||
fcntl.flock(lock, fcntl.LOCK_UN)
|
||||
Reference in new issue
Block a user