Tests / confs/tests.py
TestConferenceOgImage::test_management_command_renders_missing_and_skips_current
First seen 12 hours ago in 0c23747
CI
github-actions:test
4 runs
Average
1.98 s
median 1.97 s
max 2.88 s
max 2.88 s
Phases
Setup 22 ms
Call 1.96 s
Teardown 0.36 ms
Categories
App code 57 ms
Database 45 ms
Factories 2 ms
Other (Libraries, Imports, pytest, Unsampled) 1.88 s
17 database queries per run
Needs 36 MB of memory (max 36 MB)
Duration per run
Where the time goes
Latest run in ci:github-actions:test, 6 hours ago ·
open run
setup16 ms1.4%
TestCase.setUpClassdjango/test/testcases.py:1426 cls.cls_atomics = cls._enter_atomics()12 ms1.1%
TestCase._enter_atomicsdjango/test/testcases.py:139912 ms1.1%
Atomic.__enter__django/db/transaction.py:21012 ms1.1%
BaseDatabaseWrapper.get_autocommitdjango/db/backends/base/base.py:45412 ms1.1%
SimpleTestCase.ensure_connection_patch_method.<locals>.patched_ensure_connectiondjango/test/testcases.py:30412 ms1.1%
async_unsafe.<locals>.decorator.<locals>.innerdjango/utils/asyncio.py:2612 ms1.1%
BaseDatabaseWrapper.ensure_connectiondjango/db/backends/base/base.py:27912 ms1.1%
async_unsafe.<locals>.decorator.<locals>.innerdjango/utils/asyncio.py:2612 ms1.1%
BaseDatabaseWrapper.connectdjango/db/backends/base/base.py:25612 ms1.1%
async_unsafe.<locals>.decorator.<locals>.innerdjango/utils/asyncio.py:2612 ms1.1%
DatabaseWrapper.get_new_connectiondjango/db/backends/postgresql/base.py:34512 ms1.1%
Connection.connectpsycopg/connection.py:10912 ms1.1%
wait_connpsycopg/waiting.py:1458 ms0.7%
BaseConnection._connect_genpsycopg/_connection_base.py:4398 ms0.7%
1 smaller frames hidden
1 smaller frames hidden
call1.08 s98.5%
TestConferenceOgImage.test_management_command_renders_missing_and_skips_currentconfs/tests.py:1465 call_command("update_conference_og_images")837 ms76.3%
call_commanddjango/core/management/__init__.py:195834 ms76.0%
RichCommand.executedjango_rich/management/__init__.py:34834 ms76.0%
BaseCommand.executedjango/core/management/base.py:466834 ms76.0%
Command.handleconfs/management/commands/update_conference_og_images.py:41 render_conference_og_image(conference)823 ms75.0%
render_conference_og_imageconfs/og_images.py:240 image = render_conference_og_image_to_image_obj(conference)665 ms60.6%
render_conference_og_image_to_image_objconfs/og_images.py:230 return image.resize(RESOLUTION, resample=Image.Resampling.LANCZOS)291 ms26.5%
Image.resizePIL/Image.py:2438291 ms26.5%
render_conference_og_image_to_image_objconfs/og_images.py:18083 ms7.6%
_draw_centeredconfs/og_images.py:7542 ms3.8%
draw_text_with_emojistarter_packs/splash_images.py:31727 ms2.4%
split_text_emoji_segmentsstarter_packs/splash_images.py:286 segments[-1]["width"] = image_draw.textlength(segments[-1]["content"], current_font)25 ms2.2%
ImageDraw.textlengthPIL/ImageDraw.py:70825 ms2.2%
Text.get_lengthPIL/ImageText.py:31725 ms2.2%
FreeTypeFont.getlengthPIL/ImageFont.py:40325 ms2.2%
1 smaller frames hidden
draw_text_with_emojistarter_packs/splash_images.py:345 image_draw.text(15 ms1.4%
ImageDraw.textPIL/ImageDraw.py:64715 ms1.4%
ImageDraw.text.<locals>.draw_textPIL/ImageDraw.py:5919 ms0.8%
FreeTypeFont.getmask2PIL/ImageFont.py:6539 ms0.8%
ImageDraw.text.<locals>.draw_textPIL/ImageDraw.py:6366 ms0.6%
_draw_centeredconfs/og_images.py:7341 ms3.7%
_fit_font_sizeconfs/og_images.py:6436 ms3.3%
_text_widthconfs/og_images.py:5436 ms3.3%
split_text_emoji_segmentsstarter_packs/splash_images.py:286 segments[-1]["width"] = image_draw.textlength(segments[-1]["content"], current_font)23 ms2.1%
ImageDraw.textlengthPIL/ImageDraw.py:70821 ms2.0%
Text.get_lengthPIL/ImageText.py:31721 ms2.0%
FreeTypeFont.getlengthPIL/ImageFont.py:40321 ms2.0%
split_text_emoji_segmentsstarter_packs/splash_images.py:300 bbox = image_draw.textbbox((0, 0), segment["content"], segment["font"])13 ms1.2%
ImageDraw.textbboxPIL/ImageDraw.py:73613 ms1.2%
Text.get_bboxPIL/ImageText.py:49113 ms1.2%
Text._get_bboxPIL/ImageText.py:45513 ms1.2%
FreeTypeFont.getbboxPIL/ImageFont.py:46413 ms1.2%
1 smaller frames hidden
render_conference_og_image_to_image_objconfs/og_images.py:169 _draw_centered(65 ms6.0%
_draw_centeredconfs/og_images.py:7537 ms3.4%
draw_text_with_emojistarter_packs/splash_images.py:345 image_draw.text(26 ms2.3%
ImageDraw.textPIL/ImageDraw.py:64726 ms2.3%
ImageDraw.text.<locals>.draw_textPIL/ImageDraw.py:63618 ms1.7%
ImageDraw.text.<locals>.draw_textPIL/ImageDraw.py:5917 ms0.7%
FreeTypeFont.getmask2PIL/ImageFont.py:6537 ms0.7%
draw_text_with_emojistarter_packs/splash_images.py:31711 ms1.0%
split_text_emoji_segmentsstarter_packs/splash_images.py:286 segments[-1]["width"] = image_draw.textlength(segments[-1]["content"], current_font)9 ms0.8%
ImageDraw.textlengthPIL/ImageDraw.py:7088 ms0.7%
Text.get_lengthPIL/ImageText.py:3178 ms0.7%
FreeTypeFont.getlengthPIL/ImageFont.py:4038 ms0.7%
2 smaller frames hidden
_draw_centeredconfs/og_images.py:7329 ms2.6%
_fit_font_sizeconfs/og_images.py:6421 ms2.0%
_text_widthconfs/og_images.py:5421 ms2.0%
split_text_emoji_segmentsstarter_packs/splash_images.py:300 bbox = image_draw.textbbox((0, 0), segment["content"], segment["font"])12 ms1.1%
ImageDraw.textbboxPIL/ImageDraw.py:73612 ms1.1%
Text.get_bboxPIL/ImageText.py:49112 ms1.1%
Text._get_bboxPIL/ImageText.py:45512 ms1.1%
FreeTypeFont.getbboxPIL/ImageFont.py:46412 ms1.1%
split_text_emoji_segmentsstarter_packs/splash_images.py:286 segments[-1]["width"] = image_draw.textlength(segments[-1]["content"], current_font)9 ms0.8%
ImageDraw.textlengthPIL/ImageDraw.py:7089 ms0.8%
Text.get_lengthPIL/ImageText.py:3179 ms0.8%
FreeTypeFont.getlengthPIL/ImageFont.py:4039 ms0.8%
_fit_font_sizeconfs/og_images.py:637 ms0.7%
render_conference_og_image_to_image_objconfs/og_images.py:158 _draw_centered(65 ms6.0%
_draw_centeredconfs/og_images.py:7338 ms3.4%
_fit_font_sizeconfs/og_images.py:6432 ms2.9%
_text_widthconfs/og_images.py:5432 ms2.9%
split_text_emoji_segmentsstarter_packs/splash_images.py:286 segments[-1]["width"] = image_draw.textlength(segments[-1]["content"], current_font)18 ms1.7%
ImageDraw.textlengthPIL/ImageDraw.py:70818 ms1.7%
Text.get_lengthPIL/ImageText.py:31717 ms1.6%
FreeTypeFont.getlengthPIL/ImageFont.py:40316 ms1.5%
1 smaller frames hidden
1 smaller frames hidden
split_text_emoji_segmentsstarter_packs/splash_images.py:300 bbox = image_draw.textbbox((0, 0), segment["content"], segment["font"])12 ms1.1%
ImageDraw.textbboxPIL/ImageDraw.py:73612 ms1.1%
Text.get_bboxPIL/ImageText.py:49112 ms1.1%
Text._get_bboxPIL/ImageText.py:45512 ms1.1%
FreeTypeFont.getbboxPIL/ImageFont.py:46412 ms1.1%
1 smaller frames hidden
_fit_font_sizeconfs/og_images.py:636 ms0.6%
_draw_centeredconfs/og_images.py:7527 ms2.4%
draw_text_with_emojistarter_packs/splash_images.py:31718 ms1.7%
split_text_emoji_segmentsstarter_packs/splash_images.py:286 segments[-1]["width"] = image_draw.textlength(segments[-1]["content"], current_font)12 ms1.1%
ImageDraw.textlengthPIL/ImageDraw.py:70812 ms1.1%
Text.get_lengthPIL/ImageText.py:31712 ms1.1%
FreeTypeFont.getlengthPIL/ImageFont.py:40312 ms1.1%
2 smaller frames hidden
draw_text_with_emojistarter_packs/splash_images.py:345 image_draw.text(8 ms0.7%
ImageDraw.textPIL/ImageDraw.py:6478 ms0.7%
ImageDraw.text.<locals>.draw_textPIL/ImageDraw.py:5917 ms0.7%
FreeTypeFont.getmask2PIL/ImageFont.py:6537 ms0.7%
1 smaller frames hidden
render_conference_og_image_to_image_objconfs/og_images.py:14962 ms5.7%
_gradient_backgroundconfs/og_images.py:99 background.paste(mixed_color, (x, 0, x + 1, height))47 ms4.3%
Image.pastePIL/Image.py:193033 ms3.0%
Image.pastePIL/Image.py:19247 ms0.7%
1 smaller frames hidden
_gradient_backgroundconfs/og_images.py:90 background = Image.new("RGBA", (width, height))10 ms0.9%
newPIL/Image.py:323910 ms0.9%
3 smaller frames hidden
render_conference_og_image_to_image_objconfs/og_images.py:229 image = image.convert("RGB")28 ms2.5%
Image.convertPIL/Image.py:123428 ms2.5%
render_conference_og_image_to_image_objconfs/og_images.py:19328 ms2.5%
_fit_font_sizeconfs/og_images.py:6419 ms1.8%
_text_widthconfs/og_images.py:5419 ms1.8%
split_text_emoji_segmentsstarter_packs/splash_images.py:300 bbox = image_draw.textbbox((0, 0), segment["content"], segment["font"])12 ms1.1%
ImageDraw.textbboxPIL/ImageDraw.py:73612 ms1.1%
Text.get_bboxPIL/ImageText.py:49112 ms1.1%
Text._get_bboxPIL/ImageText.py:45512 ms1.1%
FreeTypeFont.getbboxPIL/ImageFont.py:46412 ms1.1%
split_text_emoji_segmentsstarter_packs/splash_images.py:286 segments[-1]["width"] = image_draw.textlength(segments[-1]["content"], current_font)7 ms0.7%
ImageDraw.textlengthPIL/ImageDraw.py:7086 ms0.6%
Text.get_lengthPIL/ImageText.py:3176 ms0.6%
FreeTypeFont.getlengthPIL/ImageFont.py:4036 ms0.6%
_fit_font_sizeconfs/og_images.py:638 ms0.7%
_load_fontsconfs/og_images.py:47 ImageFont.truetype(path, size) for path in glob.glob(str(settings.BASE_DIR / "static" / "NotoSans*.ttf"))8 ms0.7%
render_conference_og_image_to_image_objconfs/og_images.py:221 draw.text(16 ms1.5%
ImageDraw.textPIL/ImageDraw.py:64716 ms1.5%
ImageDraw.text.<locals>.draw_textPIL/ImageDraw.py:59115 ms1.4%
FreeTypeFont.getmask2PIL/ImageFont.py:65315 ms1.4%
1 smaller frames hidden
render_conference_og_image_to_image_objconfs/og_images.py:20613 ms1.2%
draw_text_with_emojistarter_packs/splash_images.py:345 image_draw.text(7 ms0.7%
ImageDraw.textPIL/ImageDraw.py:6477 ms0.7%
draw_text_with_emojistarter_packs/splash_images.py:3176 ms0.6%
render_conference_og_image_to_image_objconfs/og_images.py:1948 ms0.7%
_text_widthconfs/og_images.py:548 ms0.7%
split_text_emoji_segmentsstarter_packs/splash_images.py:286 segments[-1]["width"] = image_draw.textlength(segments[-1]["content"], current_font)8 ms0.7%
ImageDraw.textlengthPIL/ImageDraw.py:7088 ms0.7%
Text.get_lengthPIL/ImageText.py:3178 ms0.7%
FreeTypeFont.getlengthPIL/ImageFont.py:4038 ms0.7%
1 smaller frames hidden
render_conference_og_imageconfs/og_images.py:246 image.save(image_path)150 ms13.7%
Image.savePIL/Image.py:2711149 ms13.6%
_savePIL/PngImagePlugin.py:1522149 ms13.6%
_savePIL/ImageFile.py:667149 ms13.6%
_encode_tilePIL/ImageFile.py:693149 ms13.6%
1 smaller frames hidden
1 smaller frames hidden
Command.handleconfs/management/commands/update_conference_og_images.py:36 self.console.print(f"Found {len(conferences)} conferences to update.")8 ms0.7%
Console.printrich/console.py:17057 ms0.7%
Console._collect_renderablesrich/console.py:15607 ms0.7%
1 smaller frames hidden
1 smaller frames hidden
1 smaller frames hidden
TestConferenceOgImage.test_management_command_renders_missing_and_skips_currentconfs/tests.py:1461234 ms21.3%
render_conference_og_imageconfs/og_images.py:240 image = render_conference_og_image_to_image_obj(conference)168 ms15.3%
render_conference_og_image_to_image_objconfs/og_images.py:230 return image.resize(RESOLUTION, resample=Image.Resampling.LANCZOS)55 ms5.0%
Image.resizePIL/Image.py:243855 ms5.0%
render_conference_og_image_to_image_objconfs/og_images.py:158 _draw_centered(47 ms4.3%
_draw_centeredconfs/og_images.py:7341 ms3.7%
_fit_font_sizeconfs/og_images.py:6440 ms3.6%
_text_widthconfs/og_images.py:5440 ms3.6%
split_text_emoji_segmentsstarter_packs/splash_images.py:26332 ms2.9%
is_character_in_fontstarter_packs/splash_images.py:192 for table in TTFONT_CACHE[font_path]["cmap"].tables:28 ms2.5%
TTFont.__getitem__fontTools/ttLib/ttFont.py:81728 ms2.5%
TTFont._readTablefontTools/ttLib/ttFont.py:83016 ms1.5%
getTableClassfontTools/ttLib/ttFont.py:149416 ms1.5%
getTableModulefontTools/ttLib/ttFont.py:143416 ms1.5%
_find_and_load<frozen importlib._bootstrap>:134715 ms1.4%
_find_and_load_unlocked<frozen importlib._bootstrap>:130914 ms1.3%
_load_unlocked<frozen importlib._bootstrap>:91514 ms1.3%
_LoaderBasics.exec_module<frozen importlib._bootstrap_external>:74312 ms1.1%
SourceLoader.get_code<frozen importlib._bootstrap_external>:87712 ms1.1%
SourceLoader.source_to_code<frozen importlib._bootstrap_external>:80612 ms1.1%
_call_with_frames_removed<frozen importlib._bootstrap>:54912 ms1.1%
1 smaller frames hidden
1 smaller frames hidden
1 smaller frames hidden
TTFont._readTablefontTools/ttLib/ttFont.py:83511 ms1.0%
table__c_m_a_p.decompilefontTools/ttLib/tables/_c_m_a_p.py:22711 ms1.0%
CmapSubtable.__getattr__fontTools/ttLib/tables/_c_m_a_p.py:34711 ms1.0%
CmapSubtable.ensureDecompiledfontTools/ttLib/tables/_c_m_a_p.py:33611 ms1.0%
cmap_format_4.decompilefontTools/ttLib/tables/_c_m_a_p.py:9968 ms0.7%
_make_mapfontTools/ttLib/tables/_c_m_a_p.py:168 ms0.7%
TTFont.getGlyphNameManyfontTools/ttLib/ttFont.py:12038 ms0.7%
TTFont.getGlyphOrderfontTools/ttLib/ttFont.py:10778 ms0.7%
TTFont.__getitem__fontTools/ttLib/ttFont.py:8178 ms0.7%
3 smaller frames hidden
1 smaller frames hidden
3 smaller frames hidden
1 smaller frames hidden
_draw_centeredconfs/og_images.py:756 ms0.6%
render_conference_og_image_to_image_objconfs/og_images.py:18018 ms1.7%
_draw_centeredconfs/og_images.py:739 ms0.8%
_fit_font_sizeconfs/og_images.py:648 ms0.7%
_text_widthconfs/og_images.py:548 ms0.7%
1 smaller frames hidden
_draw_centeredconfs/og_images.py:759 ms0.8%
render_conference_og_image_to_image_objconfs/og_images.py:169 _draw_centered(17 ms1.6%
_draw_centeredconfs/og_images.py:759 ms0.8%
draw_text_with_emojistarter_packs/splash_images.py:345 image_draw.text(6 ms0.6%
ImageDraw.textPIL/ImageDraw.py:6476 ms0.6%
1 smaller frames hidden
_draw_centeredconfs/og_images.py:738 ms0.7%
_fit_font_sizeconfs/og_images.py:648 ms0.7%
_text_widthconfs/og_images.py:548 ms0.7%
render_conference_og_image_to_image_objconfs/og_images.py:14912 ms1.1%
_gradient_backgroundconfs/og_images.py:99 background.paste(mixed_color, (x, 0, x + 1, height))9 ms0.8%
2 smaller frames hidden
5 smaller frames hidden
render_conference_og_imageconfs/og_images.py:246 image.save(image_path)62 ms5.7%
Image.savePIL/Image.py:266032 ms2.9%
_import_plugin_for_extensionPIL/Image.py:42232 ms2.9%
_find_and_load<frozen importlib._bootstrap>:135032 ms2.9%
_find_and_load_unlocked<frozen importlib._bootstrap>:130932 ms2.9%
_load_unlocked<frozen importlib._bootstrap>:91532 ms2.9%
_LoaderBasics.exec_module<frozen importlib._bootstrap_external>:74717 ms1.6%
_call_with_frames_removed<frozen importlib._bootstrap>:54917 ms1.6%
<module>PIL/PngImagePlugin.py:4516 ms1.5%
_handle_fromlist<frozen importlib._bootstrap>:141816 ms1.5%
_call_with_frames_removed<frozen importlib._bootstrap>:54916 ms1.5%
_find_and_load<frozen importlib._bootstrap>:135016 ms1.5%
_find_and_load_unlocked<frozen importlib._bootstrap>:130916 ms1.5%
_load_unlocked<frozen importlib._bootstrap>:91516 ms1.5%
_LoaderBasics.exec_module<frozen importlib._bootstrap_external>:74312 ms1.1%
SourceLoader.get_code<frozen importlib._bootstrap_external>:87712 ms1.1%
SourceLoader.source_to_code<frozen importlib._bootstrap_external>:80612 ms1.1%
_call_with_frames_removed<frozen importlib._bootstrap>:54912 ms1.1%
1 smaller frames hidden
1 smaller frames hidden
_LoaderBasics.exec_module<frozen importlib._bootstrap_external>:74314 ms1.3%
SourceLoader.get_code<frozen importlib._bootstrap_external>:87714 ms1.3%
SourceLoader.source_to_code<frozen importlib._bootstrap_external>:80614 ms1.3%
_call_with_frames_removed<frozen importlib._bootstrap>:54914 ms1.3%
Image.savePIL/Image.py:271130 ms2.7%
_savePIL/PngImagePlugin.py:152229 ms2.6%
_savePIL/ImageFile.py:66729 ms2.6%
_encode_tilePIL/ImageFile.py:69329 ms2.6%
1 smaller frames hidden
1 smaller frames hidden
2 smaller frames hidden
5 smaller frames hidden
Estimated from 1,071 samples; phase durations are exact. Frames from pytest and pluggy are
hidden
.
Hot lines in your code
|
confs/og_images.py:230
return image.resize(RESOLUTION, resample=Image.Resampling.LANCZOS)
render_conference_og_image_to_image_obj
· Libraries
|
346 ms |
|
confs/og_images.py:246
image.save(image_path)
render_conference_og_image
· Libraries
|
213 ms |
|
starter_packs/splash_images.py:286
segments[-1]["width"] = image_draw.textlength(segments[-1]["content"], current_font)
split_text_emoji_segments
· Libraries
|
143 ms |
|
starter_packs/splash_images.py:300
bbox = image_draw.textbbox((0, 0), segment["content"], segment["font"])
split_text_emoji_segments
· Libraries
|
72 ms |
|
starter_packs/splash_images.py:345
image_draw.text(
draw_text_with_emoji
· Libraries
|
71 ms |
|
confs/og_images.py:99
background.paste(mixed_color, (x, 0, x + 1, height))
_gradient_background
· Libraries
|
56 ms |
|
confs/og_images.py:229
image = image.convert("RGB")
render_conference_og_image_to_image_obj
· Libraries
|
33 ms |
|
starter_packs/splash_images.py:192
for table in TTFONT_CACHE[font_path]["cmap"].tables:
is_character_in_font
· Imports
|
32 ms |
|
confs/og_images.py:47
ImageFont.truetype(path, size) for path in glob.glob(str(settings.BASE_DIR / "static" / "NotoSans*.ttf"))
_load_fonts
· Libraries
|
26 ms |
|
confs/og_images.py:221
draw.text(
render_conference_og_image_to_image_obj
· Libraries
|
19 ms |
Fixtures
Exact setup time| _unittest_setUpClass_fixture_TestConferenceOgImage class | 12 ms |
| _django_setup_unittest class | 0.55 ms |
| _dj_autoclear_mailbox function | 0.05 ms |
| _django_db_marker function | 0.05 ms |
| _template_string_if_invalid_marker function | 0.05 ms |
| _live_server_helper function | 0.04 ms |
| _django_isolate_apps function | 0.03 ms |
| _django_clear_site_cache function | 0.03 ms |
| _django_set_urlconf function | 0.03 ms |
| monkeypatch function | 0.02 ms |
Database
17 queries · 14 ms
Repeated queries are usually N+1 lookups: fetch them once with select_related / prefetch_related (or selectinload).
6×
UPDATE "confs_conference" SET "og_image" = %s, "og_image_signature" = %s, "og_image_updated_at" = %s, "og_image_needs_update" = %s WHERE "confs_conference"."id" = %s
4×
SELECT "confs_conference"."id", "confs_conference"."name", "confs_conference"."slug", "confs_conference"."location", "confs_conference"."start_date", "confs_conference"."end_date", "confs_conference"."time_zone", "confs_conference"."archived_date", "confs_conference"."approved_at", "confs_conferenc…
Biggest pieces of work
|
call test body
confs/tests.py:1465
|
1.08 s |
|
setup setUpClass
django/test/testcases.py:1426
|
12 ms |
|
setup __init__
__init__:-1
|
3 ms |
|
call _post_teardown
django/test/testcases.py:1243
|
2 ms |
Reliability
5 results · 0 CI failures · 0 local failuresThis test hasn't failed recently.
History
Latest 5 results, oldest first in the strip| When | Environment | Outcome | Duration | |
|---|---|---|---|---|
| 6 hours ago | CI github-actions:test | passed | 1.10 s | Profile |
| 6 hours ago | CI github-actions:test | passed | 2.43 s | Profile |
| 7 hours ago | CI github-actions:test | passed | 2.88 s | Profile |
| 11 hours ago | CI github-actions:test | passed | 1.52 s | Profile |
| 12 hours ago | CI github-actions:test | passed | 865 ms | Run |