Commit 9594a8c
authored
test: Respect context manager lifecycles in
In the static trace lifecycle, set `span.start_timestamp` and `span.timestamp` immediately after `__enter__` and `__exit__` are called, respectively.
In the streaming trace lifecycle, set both `span._start_timestamp` and `span._end_timestamp` immediately after `__enter__` is called, since the query source is added inside the context manager. Then reset `span._end_timestamp` immediately before `__exit__`, as otherwise the span is not captured.fake_record_sql_queries (#6295)1 parent 75aaebf commit 9594a8c
2 files changed
Lines changed: 29 additions & 45 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
346 | 346 | | |
347 | 347 | | |
348 | 348 | | |
349 | | - | |
350 | | - | |
351 | | - | |
352 | | - | |
353 | | - | |
| 349 | + | |
354 | 350 | | |
355 | 351 | | |
| 352 | + | |
| 353 | + | |
356 | 354 | | |
357 | 355 | | |
358 | 356 | | |
359 | | - | |
| 357 | + | |
| 358 | + | |
360 | 359 | | |
361 | 360 | | |
362 | 361 | | |
| |||
404 | 403 | | |
405 | 404 | | |
406 | 405 | | |
407 | | - | |
408 | | - | |
409 | | - | |
410 | | - | |
411 | | - | |
| 406 | + | |
412 | 407 | | |
413 | 408 | | |
| 409 | + | |
| 410 | + | |
414 | 411 | | |
415 | 412 | | |
416 | 413 | | |
417 | | - | |
| 414 | + | |
| 415 | + | |
418 | 416 | | |
419 | 417 | | |
420 | 418 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
934 | 934 | | |
935 | 935 | | |
936 | 936 | | |
937 | | - | |
| 937 | + | |
938 | 938 | | |
939 | | - | |
940 | | - | |
941 | | - | |
942 | | - | |
943 | | - | |
944 | | - | |
945 | | - | |
946 | | - | |
947 | | - | |
948 | | - | |
949 | | - | |
| 939 | + | |
950 | 940 | | |
951 | 941 | | |
| 942 | + | |
| 943 | + | |
| 944 | + | |
952 | 945 | | |
953 | 946 | | |
954 | 947 | | |
955 | | - | |
| 948 | + | |
| 949 | + | |
956 | 950 | | |
957 | 951 | | |
958 | 952 | | |
| |||
1000 | 994 | | |
1001 | 995 | | |
1002 | 996 | | |
1003 | | - | |
| 997 | + | |
1004 | 998 | | |
1005 | | - | |
1006 | | - | |
1007 | | - | |
1008 | | - | |
1009 | | - | |
1010 | | - | |
1011 | | - | |
1012 | | - | |
1013 | | - | |
1014 | | - | |
1015 | | - | |
| 999 | + | |
1016 | 1000 | | |
1017 | 1001 | | |
| 1002 | + | |
| 1003 | + | |
1018 | 1004 | | |
1019 | 1005 | | |
1020 | 1006 | | |
1021 | | - | |
| 1007 | + | |
| 1008 | + | |
1022 | 1009 | | |
1023 | 1010 | | |
1024 | 1011 | | |
| |||
1159 | 1146 | | |
1160 | 1147 | | |
1161 | 1148 | | |
1162 | | - | |
| 1149 | + | |
1163 | 1150 | | |
1164 | | - | |
1165 | | - | |
1166 | | - | |
1167 | | - | |
1168 | | - | |
| 1151 | + | |
1169 | 1152 | | |
1170 | 1153 | | |
| 1154 | + | |
| 1155 | + | |
1171 | 1156 | | |
1172 | 1157 | | |
1173 | 1158 | | |
1174 | | - | |
| 1159 | + | |
| 1160 | + | |
1175 | 1161 | | |
1176 | 1162 | | |
1177 | 1163 | | |
| |||
0 commit comments