Commit 9bf88a5
authored
BugFix: Random test failure when tracking compilation time (#1713)
test: "tracks proper time of compiling the factory"
source: acceptance/activesupport_instrumentation_spec.rb:99
The test sporadically fails with a complitation time of 0:
The issue, is that the "factory_bot.compile_factory"
intrumentation is actually triggered twice, not just once.
First for :user and secondly for :configuration.
The :configuration compilation time, which can indeed be 0,
is the last one triggered, so that's the elapsed time recorded
by :time_to_execute.
By changing :time_to_execute to a hash, and recording the individual
compilations, we can check just the :user compilation time with
`time_to_execute[:user]`.1 parent 7771828 commit 9bf88a5
1 file changed
+5
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
97 | 97 | | |
98 | 98 | | |
99 | 99 | | |
100 | | - | |
101 | | - | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
102 | 104 | | |
103 | 105 | | |
104 | 106 | | |
105 | 107 | | |
106 | | - | |
| 108 | + | |
107 | 109 | | |
108 | 110 | | |
109 | 111 | | |
| |||
0 commit comments