Publish restartable Git transfers for completed study checkpoints
Browse files- logs/recover-s23-late-publication.log +109 -0
- logs/transient-outage-recovery.log +1 -0
- publication.json +25 -20
- research/docs/study.json +0 -0
- research/reports/paper.pdf +0 -0
- research/reports/progress.md +1 -1
- research/src/thirdloss/release.py +20 -3
- research/tests/test_hub_archive.py +19 -0
logs/recover-s23-late-publication.log
CHANGED
|
@@ -185,3 +185,112 @@ New Data Upload : 100%|##########| 240kB / 240kB, 20.6kB/s
|
|
| 185 |
Validating : ##########| 100%
|
| 186 |
|
| 187 |
: 100%|##########| 299kB / 299kB
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 185 |
Validating : ##########| 100%
|
| 186 |
|
| 187 |
: 100%|##########| 299kB / 299kB
|
| 188 |
+
|
| 189 |
+
Processing Files (0 / 0) : | | 0.00B / 0.00B
|
| 190 |
+
|
| 191 |
+
New Data Upload : | | 0.00B / 0.00B [A
|
| 192 |
+
|
| 193 |
+
|
| 194 |
+
: 100%|##########| 158kB / 158kB [A[A
|
| 195 |
+
|
| 196 |
+
|
| 197 |
+
: 100%|##########| 158kB / 158kB [A[A
|
| 198 |
+
Processing Files (1 / 1) : 58%|#####8 | 642kB / 1.10MB, ???B/s
|
| 199 |
+
|
| 200 |
+
|
| 201 |
+
: 29%|##8 | 185kB / 646kB [A[A
|
| 202 |
+
|
| 203 |
+
|
| 204 |
+
: 100%|##########| 299kB / 299kB [A[A
|
| 205 |
+
|
| 206 |
+
|
| 207 |
+
: 100%|##########| 299kB / 299kB [A[A
|
| 208 |
+
|
| 209 |
+
|
| 210 |
+
: 100%|##########| 299kB / 299kB [A[A
|
| 211 |
+
|
| 212 |
+
|
| 213 |
+
: 29%|##8 | 185kB / 646kB [A[A
|
| 214 |
+
|
| 215 |
+
|
| 216 |
+
: 29%|##8 | 185kB / 646kB [A[A
|
| 217 |
+
|
| 218 |
+
|
| 219 |
+
: 29%|##8 | 185kB / 646kB [A[A
|
| 220 |
+
|
| 221 |
+
|
| 222 |
+
: 29%|##8 | 185kB / 646kB [A[A
|
| 223 |
+
|
| 224 |
+
|
| 225 |
+
: 100%|##########| 158kB / 158kB [A[A
|
| 226 |
+
Processing Files (1 / 1) : 100%|##########| 1.10MB / 1.10MB, 103kB/s
|
| 227 |
+
|
| 228 |
+
New Data Upload : 100%|##########| 460kB / 460kB, 44.7kB/s [A
|
| 229 |
+
|
| 230 |
+
|
| 231 |
+
: 100%|##########| 158kB / 158kB [A[A
|
| 232 |
+
|
| 233 |
+
|
| 234 |
+
: 100%|##########| 646kB / 646kB [A[A
|
| 235 |
+
|
| 236 |
+
|
| 237 |
+
: 100%|##########| 299kB / 299kB [A[A
|
| 238 |
+
|
| 239 |
+
|
| 240 |
+
: 100%|##########| 646kB / 646kB [A[A
|
| 241 |
+
|
| 242 |
+
|
| 243 |
+
: 100%|##########| 158kB / 158kB [A[A
|
| 244 |
+
|
| 245 |
+
|
| 246 |
+
: 100%|##########| 646kB / 646kB [A[A
|
| 247 |
+
|
| 248 |
+
|
| 249 |
+
: 100%|##########| 646kB / 646kB [A[A
|
| 250 |
+
|
| 251 |
+
|
| 252 |
+
: 100%|##########| 299kB / 299kB [A[A
|
| 253 |
+
|
| 254 |
+
|
| 255 |
+
|
| 256 |
+
Validating : | 0% [A[A[A
|
| 257 |
+
|
| 258 |
+
|
| 259 |
+
|
| 260 |
+
Validating : | 0% [A[A[A
|
| 261 |
+
|
| 262 |
+
|
| 263 |
+
: 100%|##########| 299kB / 299kB [A[A
|
| 264 |
+
|
| 265 |
+
|
| 266 |
+
|
| 267 |
+
Validating : | 0% [A[A[A
|
| 268 |
+
|
| 269 |
+
|
| 270 |
+
: 100%|##########| 158kB / 158kB [A[A
|
| 271 |
+
|
| 272 |
+
|
| 273 |
+
|
| 274 |
+
Validating : ##########| 100% [A[A[A
|
| 275 |
+
|
| 276 |
+
|
| 277 |
+
: 100%|##########| 299kB / 299kB [A[A
|
| 278 |
+
|
| 279 |
+
|
| 280 |
+
|
| 281 |
+
Validating : ##########| 100% [A[A[A
|
| 282 |
+
|
| 283 |
+
|
| 284 |
+
: 100%|##########| 158kB / 158kB [A[A
|
| 285 |
+
|
| 286 |
+
|
| 287 |
+
|
| 288 |
+
Validating : ##########| 100% [A[A[A
|
| 289 |
+
Processing Files (1 / 1) : 100%|##########| 1.10MB / 1.10MB, 91.5kB/s
|
| 290 |
+
|
| 291 |
+
New Data Upload : 100%|##########| 460kB / 460kB, 39.7kB/s
|
| 292 |
+
|
| 293 |
+
Validating : ##########| 100%
|
| 294 |
+
|
| 295 |
+
: 100%|##########| 158kB / 158kB
|
| 296 |
+
Published stories-hybrid-s23-late-r01
|
logs/transient-outage-recovery.log
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
findfont: Failed to find font weight semibold for DejaVu Sans, now using 700.
|
publication.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
{
|
| 2 |
"collection": "BurnyCoder/third-derivatives-in-language-model-training-6b067fb7d5ae3eca49ebb378",
|
| 3 |
-
"git_revision": "
|
| 4 |
"repositories": {
|
| 5 |
"BurnyCoder/thirdloss-arxiv-abstracts-2024": {
|
| 6 |
"files": {
|
|
@@ -91,12 +91,12 @@
|
|
| 91 |
"size": 9426
|
| 92 |
},
|
| 93 |
"study.json": {
|
| 94 |
-
"git_blob": "
|
| 95 |
-
"sha256": "
|
| 96 |
"size": 2153540
|
| 97 |
}
|
| 98 |
},
|
| 99 |
-
"revision": "
|
| 100 |
"type": "space"
|
| 101 |
},
|
| 102 |
"BurnyCoder/thirdloss-pythia-410m-adapters": {
|
|
@@ -1544,9 +1544,9 @@
|
|
| 1544 |
"size": 158
|
| 1545 |
},
|
| 1546 |
"logs/recover-s23-late-publication.log": {
|
| 1547 |
-
"git_blob": "
|
| 1548 |
-
"sha256": "
|
| 1549 |
-
"size":
|
| 1550 |
},
|
| 1551 |
"logs/stories-branch-s21-trunk-r01-20261125T103522576232Z.jsonl": {
|
| 1552 |
"git_blob": "1fa0317bc627e9cafc2ac47ee1257c5b660642e8",
|
|
@@ -1758,6 +1758,11 @@
|
|
| 1758 |
"sha256": "437c92ad7a4d9a3751c9c1402b26a6f2340b9521b46dc55d0636446b8264bb6b",
|
| 1759 |
"size": 298981
|
| 1760 |
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1761 |
"logs/update-diagnostic-modelcard.log": {
|
| 1762 |
"git_blob": "86afaf365d1f2181f812d84b59017f771f2e9683",
|
| 1763 |
"sha256": "053f7023f83a29d70d3dd14f2b60c02873babd6f94f64dab577c679746bf78ae",
|
|
@@ -1904,8 +1909,8 @@
|
|
| 1904 |
"size": 8150
|
| 1905 |
},
|
| 1906 |
"research/docs/study.json": {
|
| 1907 |
-
"git_blob": "
|
| 1908 |
-
"sha256": "
|
| 1909 |
"size": 2153540
|
| 1910 |
},
|
| 1911 |
"research/docs/third-derivative-penalty.md": {
|
|
@@ -2339,8 +2344,8 @@
|
|
| 2339 |
"size": 7290
|
| 2340 |
},
|
| 2341 |
"research/reports/paper.pdf": {
|
| 2342 |
-
"git_blob": "
|
| 2343 |
-
"sha256": "
|
| 2344 |
"size": 645568
|
| 2345 |
},
|
| 2346 |
"research/reports/plan.md": {
|
|
@@ -2359,8 +2364,8 @@
|
|
| 2359 |
"size": 5234
|
| 2360 |
},
|
| 2361 |
"research/reports/progress.md": {
|
| 2362 |
-
"git_blob": "
|
| 2363 |
-
"sha256": "
|
| 2364 |
"size": 2289
|
| 2365 |
},
|
| 2366 |
"research/reports/reviews/adapter-verification.md": {
|
|
@@ -3814,9 +3819,9 @@
|
|
| 3814 |
"size": 3710
|
| 3815 |
},
|
| 3816 |
"research/src/thirdloss/release.py": {
|
| 3817 |
-
"git_blob": "
|
| 3818 |
-
"sha256": "
|
| 3819 |
-
"size":
|
| 3820 |
},
|
| 3821 |
"research/src/thirdloss/report_figures.py": {
|
| 3822 |
"git_blob": "040404ddcb284b590508954c005a7c64bc6521e8",
|
|
@@ -3879,9 +3884,9 @@
|
|
| 3879 |
"size": 16607
|
| 3880 |
},
|
| 3881 |
"research/tests/test_hub_archive.py": {
|
| 3882 |
-
"git_blob": "
|
| 3883 |
-
"sha256": "
|
| 3884 |
-
"size":
|
| 3885 |
},
|
| 3886 |
"research/tests/test_hybrid.py": {
|
| 3887 |
"git_blob": "928e48fc345fc1d8cb01ab52a86a88afdcb373c0",
|
|
@@ -3958,5 +3963,5 @@
|
|
| 3958 |
"type": "dataset"
|
| 3959 |
}
|
| 3960 |
},
|
| 3961 |
-
"verified_at": "2026-11-25T16:
|
| 3962 |
}
|
|
|
|
| 1 |
{
|
| 2 |
"collection": "BurnyCoder/third-derivatives-in-language-model-training-6b067fb7d5ae3eca49ebb378",
|
| 3 |
+
"git_revision": "ab0942010bd5b2d09e746bba9fbfc43722266042",
|
| 4 |
"repositories": {
|
| 5 |
"BurnyCoder/thirdloss-arxiv-abstracts-2024": {
|
| 6 |
"files": {
|
|
|
|
| 91 |
"size": 9426
|
| 92 |
},
|
| 93 |
"study.json": {
|
| 94 |
+
"git_blob": "43f4766d698f7af23e2b42469853f4abddb9e64c",
|
| 95 |
+
"sha256": "f3813a20533c1f3cf31cdfc9f238f27086aec6c0bed88e2dd69e52419c0a2c70",
|
| 96 |
"size": 2153540
|
| 97 |
}
|
| 98 |
},
|
| 99 |
+
"revision": "d1996494c4371a66395d024ce1a622696ad51713",
|
| 100 |
"type": "space"
|
| 101 |
},
|
| 102 |
"BurnyCoder/thirdloss-pythia-410m-adapters": {
|
|
|
|
| 1544 |
"size": 158
|
| 1545 |
},
|
| 1546 |
"logs/recover-s23-late-publication.log": {
|
| 1547 |
+
"git_blob": "760d3c3918d259644e5e900dd39cc99a07126664",
|
| 1548 |
+
"sha256": "47454eb636e56dbc462939d61c50d1db0bae853976a60642dd26f32f49f8e2d3",
|
| 1549 |
+
"size": 8744
|
| 1550 |
},
|
| 1551 |
"logs/stories-branch-s21-trunk-r01-20261125T103522576232Z.jsonl": {
|
| 1552 |
"git_blob": "1fa0317bc627e9cafc2ac47ee1257c5b660642e8",
|
|
|
|
| 1758 |
"sha256": "437c92ad7a4d9a3751c9c1402b26a6f2340b9521b46dc55d0636446b8264bb6b",
|
| 1759 |
"size": 298981
|
| 1760 |
},
|
| 1761 |
+
"logs/transient-outage-recovery.log": {
|
| 1762 |
+
"git_blob": "37bbb4bdbd164007d9e8e84ddbdb5e73b2a11e1d",
|
| 1763 |
+
"sha256": "2ae7e37a0d60013de1b3d6870314f24554d6f4af83d0ce06b372b1eed3a9b1c6",
|
| 1764 |
+
"size": 79
|
| 1765 |
+
},
|
| 1766 |
"logs/update-diagnostic-modelcard.log": {
|
| 1767 |
"git_blob": "86afaf365d1f2181f812d84b59017f771f2e9683",
|
| 1768 |
"sha256": "053f7023f83a29d70d3dd14f2b60c02873babd6f94f64dab577c679746bf78ae",
|
|
|
|
| 1909 |
"size": 8150
|
| 1910 |
},
|
| 1911 |
"research/docs/study.json": {
|
| 1912 |
+
"git_blob": "43f4766d698f7af23e2b42469853f4abddb9e64c",
|
| 1913 |
+
"sha256": "f3813a20533c1f3cf31cdfc9f238f27086aec6c0bed88e2dd69e52419c0a2c70",
|
| 1914 |
"size": 2153540
|
| 1915 |
},
|
| 1916 |
"research/docs/third-derivative-penalty.md": {
|
|
|
|
| 2344 |
"size": 7290
|
| 2345 |
},
|
| 2346 |
"research/reports/paper.pdf": {
|
| 2347 |
+
"git_blob": "9b3c0edceca10c5f6d1663addb3bb84c97935363",
|
| 2348 |
+
"sha256": "2b6fc48de24ead4b69a3227c3cce532aa1f51255f8d021b3178d81c1f79d3b7d",
|
| 2349 |
"size": 645568
|
| 2350 |
},
|
| 2351 |
"research/reports/plan.md": {
|
|
|
|
| 2364 |
"size": 5234
|
| 2365 |
},
|
| 2366 |
"research/reports/progress.md": {
|
| 2367 |
+
"git_blob": "654f50999d26ba36c58a715c2672a87557afcdca",
|
| 2368 |
+
"sha256": "ae324f77060132e88aac670b5e54cb08c22af23645c381a9f616744f4a59917f",
|
| 2369 |
"size": 2289
|
| 2370 |
},
|
| 2371 |
"research/reports/reviews/adapter-verification.md": {
|
|
|
|
| 3819 |
"size": 3710
|
| 3820 |
},
|
| 3821 |
"research/src/thirdloss/release.py": {
|
| 3822 |
+
"git_blob": "fd0f70e5d577bc4b75f9eea31b8d425d870fe55e",
|
| 3823 |
+
"sha256": "c0238697239e5e453c8fd728d02aa49c7bd0a056f66c71d58626166949a827d4",
|
| 3824 |
+
"size": 7818
|
| 3825 |
},
|
| 3826 |
"research/src/thirdloss/report_figures.py": {
|
| 3827 |
"git_blob": "040404ddcb284b590508954c005a7c64bc6521e8",
|
|
|
|
| 3884 |
"size": 16607
|
| 3885 |
},
|
| 3886 |
"research/tests/test_hub_archive.py": {
|
| 3887 |
+
"git_blob": "4c8dc24e6eb5f0aa7fc5e63be56ba0efa3ad4ec4",
|
| 3888 |
+
"sha256": "8482210735ca590533b325c5473d7b4483063c01efe16e8d97cd41e737466df4",
|
| 3889 |
+
"size": 5881
|
| 3890 |
},
|
| 3891 |
"research/tests/test_hybrid.py": {
|
| 3892 |
"git_blob": "928e48fc345fc1d8cb01ab52a86a88afdcb373c0",
|
|
|
|
| 3963 |
"type": "dataset"
|
| 3964 |
}
|
| 3965 |
},
|
| 3966 |
+
"verified_at": "2026-11-25T16:20:34+00:00"
|
| 3967 |
}
|
research/docs/study.json
CHANGED
|
The diff for this file is too large to render.
See raw diff
|
|
|
research/reports/paper.pdf
CHANGED
|
Binary files a/research/reports/paper.pdf and b/research/reports/paper.pdf differ
|
|
|
research/reports/progress.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
# Study progress
|
| 2 |
|
| 3 |
-
Updated 2026-11-25T16:
|
| 4 |
|
| 5 |
21 training/control records and 0 final evaluations are complete. This is 17.5% of 120 planned model milestones.
|
| 6 |
|
|
|
|
| 1 |
# Study progress
|
| 2 |
|
| 3 |
+
Updated 2026-11-25T16:20:22+00:00.
|
| 4 |
|
| 5 |
21 training/control records and 0 final evaluations are complete. This is 17.5% of 120 planned model milestones.
|
| 6 |
|
research/src/thirdloss/release.py
CHANGED
|
@@ -1,13 +1,15 @@
|
|
| 1 |
"""Publish the explicitly requested study artifacts using existing Git and Hugging Face logins."""
|
| 2 |
|
| 3 |
import subprocess
|
|
|
|
|
|
|
| 4 |
from pathlib import Path
|
| 5 |
|
| 6 |
from filelock import FileLock
|
| 7 |
from huggingface_hub import HfApi
|
| 8 |
|
| 9 |
from .hub_archive import COLLECTION, STAGE_HUB, publish_archive
|
| 10 |
-
from .records import GITHUB, read_json, sha256, storage_root, write_json
|
| 11 |
|
| 12 |
|
| 13 |
def publish_snapshot(project, message):
|
|
@@ -22,14 +24,29 @@ def push_main(project):
|
|
| 22 |
"""Preserve concurrent upstream commits when a completed run has a local release commit."""
|
| 23 |
def run(*args,check=True):
|
| 24 |
return subprocess.run(["git",*args],cwd=project,check=check,capture_output=True,text=True)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 25 |
for attempt in range(4):
|
| 26 |
-
pushed =
|
| 27 |
if pushed.returncode==0:
|
| 28 |
return
|
| 29 |
error = pushed.stderr.lower()
|
| 30 |
if attempt==3 or ("fetch first" not in error and "non-fast-forward" not in error):
|
| 31 |
raise RuntimeError(f"Git release push failed: {pushed.stderr.strip()}")
|
| 32 |
-
|
| 33 |
merged=run("merge","--no-edit","FETCH_HEAD",check=False)
|
| 34 |
if merged.returncode:
|
| 35 |
conflicts=run("diff","--name-only","--diff-filter=U").stdout.strip()
|
|
|
|
| 1 |
"""Publish the explicitly requested study artifacts using existing Git and Hugging Face logins."""
|
| 2 |
|
| 3 |
import subprocess
|
| 4 |
+
import re
|
| 5 |
+
import time
|
| 6 |
from pathlib import Path
|
| 7 |
|
| 8 |
from filelock import FileLock
|
| 9 |
from huggingface_hub import HfApi
|
| 10 |
|
| 11 |
from .hub_archive import COLLECTION, STAGE_HUB, publish_archive
|
| 12 |
+
from .records import GITHUB, read_json, sha256, storage_root, time_now, write_json
|
| 13 |
|
| 14 |
|
| 15 |
def publish_snapshot(project, message):
|
|
|
|
| 24 |
"""Preserve concurrent upstream commits when a completed run has a local release commit."""
|
| 25 |
def run(*args,check=True):
|
| 26 |
return subprocess.run(["git",*args],cwd=project,check=check,capture_output=True,text=True)
|
| 27 |
+
|
| 28 |
+
def remote(*args):
|
| 29 |
+
"""A transient server rejection can arrive even over a successful HTTP connection."""
|
| 30 |
+
for delay in (2,4,8,16,30,60,60,60,60,60,0):
|
| 31 |
+
result=run(*args,check=False)
|
| 32 |
+
temporary=re.search(r"internal server error|bad gateway|service unavailable|gateway timeout|"
|
| 33 |
+
r"(?:http |returned error: )(?:408|429|500|502|503|504)\b|connection (?:reset|timed out)",
|
| 34 |
+
result.stderr,re.IGNORECASE)
|
| 35 |
+
if not result.returncode or not temporary or not delay:
|
| 36 |
+
return result
|
| 37 |
+
# Retrying the identical non-forced push preserves Git's fast-forward checks.
|
| 38 |
+
# https://git-scm.com/docs/git-push#_note_about_fast_forwards
|
| 39 |
+
print(f"{time_now()} Git {args[0]} returned {temporary.group()}. Retrying in {delay}s.",flush=True)
|
| 40 |
+
time.sleep(delay)
|
| 41 |
+
|
| 42 |
for attempt in range(4):
|
| 43 |
+
pushed = remote("push","origin","main")
|
| 44 |
if pushed.returncode==0:
|
| 45 |
return
|
| 46 |
error = pushed.stderr.lower()
|
| 47 |
if attempt==3 or ("fetch first" not in error and "non-fast-forward" not in error):
|
| 48 |
raise RuntimeError(f"Git release push failed: {pushed.stderr.strip()}")
|
| 49 |
+
remote("fetch","origin","main").check_returncode()
|
| 50 |
merged=run("merge","--no-edit","FETCH_HEAD",check=False)
|
| 51 |
if merged.returncode:
|
| 52 |
conflicts=run("diff","--name-only","--diff-filter=U").stdout.strip()
|
research/tests/test_hub_archive.py
CHANGED
|
@@ -102,3 +102,22 @@ def test_result_publisher_merges_concurrent_documentation_without_losing_either(
|
|
| 102 |
assert git(remote,"show","main:worked-example.md")=="Derivation"
|
| 103 |
assert git(remote,"show","main:width.json")=="{}"
|
| 104 |
assert git(owner,"rev-parse","HEAD")==git(remote,"rev-parse","main")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 102 |
assert git(remote,"show","main:worked-example.md")=="Derivation"
|
| 103 |
assert git(remote,"show","main:width.json")=="{}"
|
| 104 |
assert git(owner,"rev-parse","HEAD")==git(remote,"rev-parse","main")
|
| 105 |
+
|
| 106 |
+
|
| 107 |
+
def test_result_publication_retries_outages_without_rewriting_history(monkeypatch,tmp_path):
|
| 108 |
+
import subprocess
|
| 109 |
+
from thirdloss import release
|
| 110 |
+
failures=iter(["remote: Internal Server Error","The requested URL returned error: 503",""])
|
| 111 |
+
calls=[]; delays=[]
|
| 112 |
+
def once(args,**kwargs):
|
| 113 |
+
calls.append(args)
|
| 114 |
+
error=next(failures)
|
| 115 |
+
return subprocess.CompletedProcess(args,int(bool(error)),stdout="",stderr=error)
|
| 116 |
+
monkeypatch.setattr(release.subprocess,"run",once)
|
| 117 |
+
monkeypatch.setattr(release.time,"sleep",delays.append)
|
| 118 |
+
release.push_main(tmp_path)
|
| 119 |
+
assert calls==[["git","push","origin","main"]]*3 and delays==[2,4]
|
| 120 |
+
failures=iter(["permission denied"])
|
| 121 |
+
with pytest.raises(RuntimeError,match="permission denied"):
|
| 122 |
+
release.push_main(tmp_path)
|
| 123 |
+
assert delays==[2,4]
|