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

Elementary support for application_controller #2

Closed
aronisstav opened this issue Apr 8, 2014 · 8 comments · Fixed by #26
Closed

Elementary support for application_controller #2

aronisstav opened this issue Apr 8, 2014 · 8 comments · Fixed by #26
Labels
feature Suggestions for new features or improvements on existing ones.

Comments

@aronisstav
Copy link
Member

No description provided.

@aronisstav aronisstav added this to the v1.0 milestone Apr 8, 2014
@aronisstav aronisstav removed the ready label May 23, 2014
aronisstav referenced this issue in aronisstav/Concuerror Jun 2, 2014
Application controller has inner state that is not guaranteed to be restored
after completion of an interleaving and needs to be checked.
@aronisstav aronisstav reopened this Jun 2, 2014
@aronisstav
Copy link
Member Author

One possible workaround: instead of starting sth as an application, call its top-level supervisor (or even better a top level gen_server). It focuses the test on the application itself and not on the boilerplate that is invoked by application_controller...

@essen
Copy link
Contributor

essen commented Aug 17, 2016

Trying to use Concuerror on a real world project and running into issues with calls like application:get_env. Is there a way to make it work? It will be difficult to isolate the code entirely from application logic.

@aronisstav
Copy link
Member Author

Hi Loïc! I can have another go on this issue. It would be great if you could send me some sample code showing what it is that you need supported.

@essen
Copy link
Contributor

essen commented Aug 17, 2016

I will get back to you on that particular issue. Basically our system is large, we use sys.config etc. so we need applications to be at the very least loaded, if not started. I will try a custom concuerror script that does all the initialization beforehand.

But then I will run into this separate issue (I can open a separate ticket if you want):

Error: Concuerror does not support calls to built-in os:timestamp/0 (found in wpool_pool.erl line 7).

I'm not sure what actually calls it, the stacktrace it gives me is not really correct, that module doesn't even have os:timestamp on the version we use (it does in the current version; we use this one https://github.com/inaka/worker_pool/blob/dc59ce01207582046c70cb3b7f4bede93bf3472e/src/wpool_pool.erl - 1.0.4).

The problem is that we have functions -> worker pool -> mnesia calls -> inbox table, with a race condition when two workers save at the same place in mnesia at the same time (they need to first retrieve the data, and then save it, so there's a case where they both read the same and then one overwrites the other).

It's a simplistic view, but ultimately that's what we want to test, because we really want our data to be there. :-)

@aronisstav
Copy link
Member Author

I just pushed #103 which has patches for both application_controller and os:timestamp/0. It will be merged to master after Travis gives the ok. 😄

For os:timestamp, keep in mind that Concuerror handles "time" in a very limited way: calls to time-related functions are not racing with each other (although that can be added) and they are "reusing" results from previous interleavings, if needed, to ensure that control flow remains the same.

I hope this helps!

@essen
Copy link
Contributor

essen commented Aug 18, 2016

Sounds good, hopefully I can finish what I'm doing soon and try again. :-)

@aronisstav aronisstav removed this from the v1.0 milestone Dec 12, 2016
@aronisstav
Copy link
Member Author

I am planning to close this one, with no fix on Concuerror's side. I am in the process of developing support for mocking (#197) and this will hopefully help in such cases.

@essen
Copy link
Contributor

essen commented Feb 20, 2018

No worries.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature Suggestions for new features or improvements on existing ones.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants