Commit 281b976
authored
fix: use posixpath for container internal paths (opensandbox-group#234)
* fix: use posixpath for container internal paths
- Replaces os.path with posixpath for paths used inside containers to ensure forward slashes are used regardless of the host OS (fixing Windows support).
- Adds unit tests to verify container internal paths.
- Formats code and optimizes imports in docker.py.
* ci: add Windows to test matrix for server unit tests
- Adds windows-latest to the OS matrix in server-test.yml.
- Sets bash as the default shell for cross-platform command compatibility.
- Ensures unit tests (including Windows path fixes) are validated on both Linux and Windows environments.
* fix: support Windows-style host paths in volume mounts
- Updates API schema to allow Windows drive letter paths.
- Enhances ensure_valid_host_path validator to correctly handle Windows absolute paths and drive letters.
- Normalizes path separators during security checks to prevent bypasses.
- Adjusts tests to be cross-platform compatible.
* test: add timeout to code interpreter context cleanup
- Wraps delete_context calls in managed_ctx with asyncio.wait_for.
- Prevents dead containers or network issues from blocking the test suite indefinitely.
* test(java): add per-execution timeout and improve interrupt stability
- Adds runWithTimeout helper to prevent hanging runCode calls from blocking tests indefinitely.
- Updates multi-language isolation tests to use this timeout.
- Relaxes interrupt event validation to expect at least one terminal event instead of an exact XOR.
* test: harden interrupt e2e tests for Python and Java
- Adds explicit timeouts and exception handling for code interrupt operations.
- Prevents tests from hanging when SSE streams are abruptly closed by the server after an interrupt.
- Relaxes result object validation to favor event-based verification after an interrupt.1 parent 8337878 commit 281b976
8 files changed
Lines changed: 372 additions & 159 deletions
File tree
- .github/workflows
- server
- src
- api
- services
- tests
- tests
- java/src/test/java/com/alibaba/opensandbox/e2e
- python/tests
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
18 | | - | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
19 | 26 | | |
20 | 27 | | |
21 | 28 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
123 | 123 | | |
124 | 124 | | |
125 | 125 | | |
126 | | - | |
127 | | - | |
| 126 | + | |
| 127 | + | |
128 | 128 | | |
129 | 129 | | |
130 | 130 | | |
| |||
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
| 24 | + | |
24 | 25 | | |
25 | 26 | | |
26 | 27 | | |
| |||
296 | 297 | | |
297 | 298 | | |
298 | 299 | | |
299 | | - | |
| 300 | + | |
300 | 301 | | |
301 | 302 | | |
302 | 303 | | |
303 | 304 | | |
304 | | - | |
| 305 | + | |
305 | 306 | | |
306 | 307 | | |
307 | 308 | | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
308 | 315 | | |
309 | | - | |
| 316 | + | |
310 | 317 | | |
311 | 318 | | |
312 | 319 | | |
| |||
316 | 323 | | |
317 | 324 | | |
318 | 325 | | |
319 | | - | |
| 326 | + | |
320 | 327 | | |
321 | 328 | | |
322 | 329 | | |
| |||
327 | 334 | | |
328 | 335 | | |
329 | 336 | | |
| 337 | + | |
330 | 338 | | |
331 | | - | |
332 | | - | |
| 339 | + | |
| 340 | + | |
333 | 341 | | |
334 | 342 | | |
335 | 343 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
582 | 582 | | |
583 | 583 | | |
584 | 584 | | |
585 | | - | |
| 585 | + | |
| 586 | + | |
| 587 | + | |
586 | 588 | | |
587 | 589 | | |
588 | 590 | | |
| |||
Lines changed: 74 additions & 21 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
590 | 590 | | |
591 | 591 | | |
592 | 592 | | |
| 593 | + | |
| 594 | + | |
| 595 | + | |
| 596 | + | |
| 597 | + | |
| 598 | + | |
| 599 | + | |
| 600 | + | |
| 601 | + | |
| 602 | + | |
| 603 | + | |
| 604 | + | |
| 605 | + | |
| 606 | + | |
| 607 | + | |
| 608 | + | |
| 609 | + | |
| 610 | + | |
| 611 | + | |
| 612 | + | |
| 613 | + | |
| 614 | + | |
| 615 | + | |
593 | 616 | | |
594 | 617 | | |
595 | 618 | | |
| |||
599 | 622 | | |
600 | 623 | | |
601 | 624 | | |
| 625 | + | |
| 626 | + | |
| 627 | + | |
| 628 | + | |
602 | 629 | | |
603 | 630 | | |
604 | 631 | | |
| |||
620 | 647 | | |
621 | 648 | | |
622 | 649 | | |
623 | | - | |
624 | | - | |
| 650 | + | |
| 651 | + | |
625 | 652 | | |
626 | 653 | | |
627 | 654 | | |
| |||
641 | 668 | | |
642 | 669 | | |
643 | 670 | | |
644 | | - | |
645 | | - | |
| 671 | + | |
| 672 | + | |
646 | 673 | | |
647 | 674 | | |
648 | 675 | | |
| |||
838 | 865 | | |
839 | 866 | | |
840 | 867 | | |
841 | | - | |
842 | | - | |
| 868 | + | |
| 869 | + | |
| 870 | + | |
| 871 | + | |
| 872 | + | |
| 873 | + | |
| 874 | + | |
| 875 | + | |
| 876 | + | |
| 877 | + | |
| 878 | + | |
| 879 | + | |
| 880 | + | |
843 | 881 | | |
844 | 882 | | |
845 | | - | |
846 | | - | |
| 883 | + | |
| 884 | + | |
| 885 | + | |
| 886 | + | |
| 887 | + | |
| 888 | + | |
847 | 889 | | |
848 | | - | |
849 | | - | |
850 | | - | |
| 890 | + | |
| 891 | + | |
| 892 | + | |
| 893 | + | |
| 894 | + | |
851 | 895 | | |
852 | 896 | | |
853 | 897 | | |
| |||
894 | 938 | | |
895 | 939 | | |
896 | 940 | | |
897 | | - | |
898 | | - | |
| 941 | + | |
| 942 | + | |
| 943 | + | |
| 944 | + | |
| 945 | + | |
| 946 | + | |
| 947 | + | |
| 948 | + | |
| 949 | + | |
| 950 | + | |
| 951 | + | |
899 | 952 | | |
900 | 953 | | |
901 | | - | |
902 | | - | |
903 | | - | |
904 | | - | |
905 | | - | |
906 | | - | |
907 | | - | |
| 954 | + | |
| 955 | + | |
| 956 | + | |
| 957 | + | |
| 958 | + | |
| 959 | + | |
| 960 | + | |
908 | 961 | | |
909 | 962 | | |
910 | 963 | | |
| |||
919 | 972 | | |
920 | 973 | | |
921 | 974 | | |
922 | | - | |
| 975 | + | |
923 | 976 | | |
924 | 977 | | |
925 | 978 | | |
| |||
0 commit comments