Must pay attention to the documentation (Erlang Edition)
Right there, in the documentation for supervisor, it says (emphasis mine)
Really.
It's just that I, apparently, didn't know it for the last 8 hours.
So there I am, writing out Common Tests for our system, and in init_per_suite I slap in (basically) the following line
Creates a supervisor process as part of a supervision tree. The function will, among other things, ensure that the supervisor is linked to the calling process (its supervisor).And I know this.
Really.
It's just that I, apparently, didn't know it for the last 8 hours.
So there I am, writing out Common Tests for our system, and in init_per_suite I slap in (basically) the following line
supervisor:start_link({local, some_module_sup}, some_module_sup, []).Wonder of wonders, everything craps out. After an eternity (ok, 8 hours), I figured out that
- init_per_suite runs will executed in its own dedicated process (as oh so helpfully stated multiple times in the documentation, and which I not only know, but have expounded on multiple times in the past)
- supervisor:start_link/3 links to its calling process, which is right there in the second line of its documentation as show above. Granted, the calling process is probably a supervisor of its own, all the way to the top when its probably an application bootstrapping the whole thing, but still, I know this.

Comments