aronisstav / Concuerror

OFFICIAL REPOSITORY MOVED:
https://github.com/parapluu/Concuerror
BSD 2-Clause "Simplified" License
1 stars 0 forks source link

Support for ports #15

Open aronisstav opened 6 years ago

aronisstav commented 6 years ago

Migrating parapluu/Concuerror#7.

fenollp commented 6 years ago

A simple enough project that uses ports & Concuerror not handling that: https://travis-ci.org/fenollp/quickcheck_test_web_service_statem/builds/360878128

$ ./concuerror.git/bin/concuerror \
    -m mylib_tests -t play_test \
    --pa _build/test/lib/mylib/test \
    --pa _build/test/lib/mylib/ebin \
    --graph concuerror.dot -o concuerror.txt   || true
Concuerror v0.18-170-g6b2feb started at 01 Apr 2018 14:05:59
Writing results in concuerror.txt
Writing graph in concuerror.dot
(0.0/s) 0 errors, 0/0 interleavings explored
* Info: Automatically instrumented module io_lib
0 errors, 0/0 interleavings explored
* Info: Automatically instrumented module mylib_tests
0 errors, 0/0 interleavings explored
* Info: Automatically instrumented module my_stateful_service
0 errors, 0/0 interleavings explored
* Info: Automatically instrumented module gen_server
0 errors, 0/0 interleavings explored
* Info: Automatically instrumented module gen
0 errors, 0/0 interleavings explored
* Tip: Increase '--print_depth' if output/graph contains "...".
0 errors, 0/1 interleavings explored
(0.0/s) 0 errors, 0/1 interleavings explored
* Info: Automatically instrumented module proc_lib
0 errors, 0/1 interleavings explored
* Info: Automatically instrumented module erlang
0 errors, 0/1 interleavings explored
* Info: Automatically instrumented module gen_tcp
0 errors, 0/1 interleavings explored
(0.0/s) 0 errors, 0/1 interleavings explored
* Info: Automatically instrumented module inet
0 errors, 0/1 interleavings explored
* Info: Automatically instrumented module inet_db
0 errors, 0/1 interleavings explored
(0.0/s) 0 errors, 0/1 interleavings explored
* Info: Automatically instrumented module lists
0 errors, 0/1 interleavings explored
* Info: Automatically instrumented module inet_tcp
0 errors, 0/1 interleavings explored
* Info: Automatically instrumented module application
0 errors, 0/1 interleavings explored
(0.0/s) 0 errors, 0/1 interleavings explored
* Info: Automatically instrumented module application_controller
0 errors, 0/1 interleavings explored
* Info: Automatically instrumented module prim_inet
0 errors, 0/1 interleavings explored
* Error: Stop testing on first error. (Check '-h keep_going').
1 errors, 1/1 interleavings explored
* Error: Concuerror does not support calls to built-in erts_internal:open_port/2 (found in erlang.erl line 2117).
  If you cannot avoid its use, please contact the developers.
  Stacktrace:
    [{erlang,open_port,2,[{file,"erlang.erl"},{line,2117}]},
     {prim_inet,open,6,[{file,"prim_inet.erl"},{line,87}]},
     {inet,open,8,[{file,"inet.erl"},{line,1346}]}]
1 errors, 1/1 interleavings explored
Done at 01 Apr 2018 14:06:02 (Exit status: fail)
  Summary: 1 errors, 1/1 interleavings explored

Any way I can contribute here? Thanks

aronisstav commented 6 years ago

@fenollp Having returned to this issue a few times over the years I am unsure about how one could extend Concuerror to support this particular use. Statelessness is hard to achieve/guarantee for network operations. Concuerror is good at capturing concurrency within the Erlang VM but would have to be extensively informed to be able to do the same outside of it (to the point that it would be unusable).

An approach that has worked (see http://concuerror.com/euc-2017-talk) is to make models for such systems, expressing network operations as message passing and using Concuerror on those.

Coming back to the Issue's title, what might be feasible is to support file read operations via ports.