Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minor code clean-up #294

Merged
merged 2 commits into from
Feb 10, 2023
Merged

Minor code clean-up #294

merged 2 commits into from
Feb 10, 2023

Conversation

jmid
Copy link
Collaborator

@jmid jmid commented Feb 2, 2023

This little PR changes the 3 remaining property functions to be written using a syntactic function header.
I noticed while merging main into #112.

As an added bonus we avoid a little indentation 😅

@jmid
Copy link
Collaborator Author

jmid commented Feb 3, 2023

Besides usual suspects (2 Dynlink + 3 Threadomain failures) CI triggered a Linux trunk failure on Sys tests:
https://github.com/ocaml-multicore/multicoretests/actions/runs/4075448085/jobs/7021852630

random seed: 236496739
generated error fail pass / total     time test name

[ ]    0    0    0    0 / 1000     0.0s STM Sys test sequential
[ ]    0    0    0    0 / 1000     0.0s STM Sys test sequential (generating)
[✓] 1000    0    0 1000 / 1000     3.3s STM Sys test sequential

[ ]    0    0    0    0 /  200     0.0s STM Sys test parallel
[ ]   64    0    0   64 /  200    56.8s STM Sys test parallel
[ ]  108    0    0  108 /  200   116.9s STM Sys test parallel
[ ]  119    0    0  119 /  200   177.3s STM Sys test parallel (shrinking:    6.0003)
[✗]  120    0    1  119 /  200   235.6s STM Sys test parallel

--- Failure --------------------------------------------------------------------

Test STM Sys test parallel failed (10 shrink steps):

File "src/sys/dune", line 4, characters 7-16:
                                                        |                      
4 |  (name stm_tests)
           ^^^^^^^^^
(cd _build/default/src/sys && ./stm_tests.exe --verbose)
Command exited with code 1.
                                  (Readdir ["ccc"; "ccc"; "ccc"; "bbb"; "ccc"])
                                                        |                      
                                .----------------------------------------------.
                                |                                              |                      
                      (File_exists ["eee"])                        (Mkfile (["aaa"], "aaa"))          
                      (Mkfile ([], "ddd"))                  (Rmdir (["bbb"; "ccc"; "bbb"], "ccc"))    
                        (Readdir ["ddd"])                          (Mkfile (["aaa"], "ddd"))          
                      (File_exists ["ddd"])                              (Readdir [])                 
                      (File_exists ["ddd"])                           (Mkdir ([], "aaa"))             
                    (Mkdir (["bbb"], "ccc"))                           (Readdir ["aaa"])              
                       (Rmdir ([], "aaa"))               (Rmdir (["ccc"; "aaa"; "ddd"; "ddd"], "aaa"))
          (Mkdir (["eee"; "eee"; "ccc"; "eee"], "ddd"))            (Mkdir (["aaa"], "ccc"))           
                       (Rmdir ([], "bbb"))                           (File_exists ["aaa"])            


+++ Messages ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Messages for test STM Sys test parallel:

  Results incompatible with linearized model

                                                                                                                                 |                                                              
                                                                    (Readdir ["ccc"; "ccc"; "ccc"; "bbb"; "ccc"]) : Error (Sys_error("_sandbox/ccc/ccc/ccc/bbb/ccc: No such file or directory"))
                                                                                                                                 |                                                              
                                                                  .-----------------------------------------------------------------------------------------------------------------------------.
                                                                  |                                                                                                                             |                                                              
                                                    (File_exists ["eee"]) : false                                                                  (Mkfile (["aaa"], "aaa")) : Error (Sys_error("_sandbox/aaa/aaa: No such file or directory"))                
                                                    (Mkfile ([], "ddd")) : Ok (())                                                      (Rmdir (["bbb"; "ccc"; "bbb"], "ccc")) : Error (Sys_error("_sandbox/bbb/ccc/bbb/ccc: No such file or directory"))      
                                (Readdir ["ddd"]) : Error (Sys_error("_sandbox/ddd: Not a directory"))                                             (Mkfile (["aaa"], "ddd")) : Error (Sys_error("_sandbox/aaa/ddd: No such file or directory"))                
                                                     (File_exists ["ddd"]) : true                                                                                                 (Readdir []) : Ok ([|"ddd"|])                                                
                                                     (File_exists ["ddd"]) : true                                                                                                 (Mkdir ([], "aaa")) : Ok (())                                                
                     (Mkdir (["bbb"], "ccc")) : Error (Sys_error("_sandbox/bbb/ccc: No such file or directory"))                                                                  (Readdir ["aaa"]) : Ok ([||])                                                
                                                    (Rmdir ([], "aaa")) : Ok (())                                                  (Rmdir (["ccc"; "aaa"; "ddd"; "ddd"], "aaa")) : Error (Sys_error("_sandbox/ccc/aaa/ddd/ddd/aaa: No such file or directory"))
     (Mkdir (["eee"; "eee"; "ccc"; "eee"], "ddd")) : Error (Sys_error("_sandbox/eee/eee/ccc/eee/ddd: No such file or directory"))                  (Mkdir (["aaa"], "ccc")) : Error (Sys_error("_sandbox/aaa/ccc: No such file or directory"))                 
                          (Rmdir ([], "bbb")) : Error (Sys_error("_sandbox/bbb: No such file or directory"))                                                                       (File_exists ["aaa"]) : true                                                

================================================================================
failure (1 tests failed, 0 tests errored, ran 2 tests)

@shym
Copy link
Collaborator

shym commented Feb 6, 2023

Unfortunately, this is an instance of the pattern: rmdir aaa in parallel with mkdir aaa/bbb; file_exists aaa, in which mkdir fails because aaa is already being removed, while file_exists succeeds because the aaa still exists a bit (in my tests for that very case, the stat syscall succeeds but reports that the inode has no physical links left, aka it does not exist...).
See this comment for details.

@jmid jmid merged commit 1c3cf7d into main Feb 10, 2023
@jmid jmid deleted the code-cleanups branch February 10, 2023 09:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants