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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
//! A fixture-owned engine that is stopped when its binding ends.
//!
//! `Drop for Engine` deliberately leaves the beamr scheduler and the engine's
//! NIF seams alive: it closes the engine-task epoch and stops the timer wheel,
//! but stopping the scheduler and clearing the seams is `Engine::shutdown`'s
//! job and nothing else's. That is the engine's contract — shutdown is the
//! caller's act — so a fixture that builds an engine and merely drops it leaks
//! the scheduler's threads and, through the uncleared seams, every store clone
//! the seams reach (which is how a durable backend's writer lock outlives the
//! test that opened it).
//!
//! Holding the engine in this guard makes the fixture keep the engine's side of
//! that contract: the test stops the engine explicitly where it can, and the
//! guard covers every early return that `?` takes.
//!
//! This is a sibling of the lib target's own guard rather than a shared one:
//! an integration test cannot reach a `#[cfg(test)]` module inside the crate
//! it links against, so the two targets each carry their own.
use Arc;
use ;
use Engine;
/// What a fixture teardown failure is called in the harness output, so the
/// line is greppable whichever way it was reported, and whichever target
/// reported it: the lib target's own guard uses this same wording.
const TEARDOWN_FAILED: &str = "aion-server test fixture teardown failed";
/// An engine a fixture built, stopped when the fixture's binding ends.