Open Bug 2086983 Opened 20 days ago

Fix print_dependents in taskcluster/test/conftest.py so it finds dependents in optimized graphs

Categories

(Firefox Build System :: Task Configuration, task)

task

Tracking

(Not tracked)

People

(Reporter: jcristau, Unassigned, Mentored)

Details

(Keywords: good-first-bug, Whiteboard: [lang=python])

Filing as a good first bug to learn workflows.

The print_dependents fixture in taskcluster/test/conftest.py is meant to print, when a taskgraph integration test fails, which tasks depend on an unexpected task. It never prints any dependents, because it checks whether a task label is in task.dependencies.values(), but the tests pass it an optimized task graph, where task.dependencies maps to task IDs rather than labels.

For example, when test_mach_try_auto.py failed in bug 2086608 because shippable builds were scheduled, the output only showed the builds themselves:

Dependent graph for build-win64-shippable/opt:
build-win64-shippable/opt

when it should have listed the perftest tasks that caused them to be scheduled.

The fix is to compare against the task ID of the task being looked up (each task in an optimized graph has a task_id attribute) instead of its label, while still printing labels in the output. The fixture is used by test_tasks_are_not_scheduled in taskcluster/test/test_mach_try_auto.py, test_autoland.py and test_autoland_backstop.py, all with optimized_task_graph.

Link to the code:
https://searchfox.org/firefox-main/rev/b0625683b9b8cd108f6b3fa9eedbcd4aa0066d6e/taskcluster/test/conftest.py#136

To verify the fix:

Temporarily make one of the test_tasks_are_not_scheduled cases in taskcluster/test/test_mach_try_auto.py match a task that has dependents (for example lambda t: t.kind == "build"), then run:

./mach python-test taskcluster/test/test_mach_try_auto.py

The failure output should now list the dependent tasks under each build. Revert the temporary change before submitting the patch.

Tutorial to contribute:
https://firefox-source-docs.mozilla.org/contributing/contribution_quickref.html
https://firefox-source-docs.mozilla.org/contributing/stack_quickref.html

Please don't ask for the bug to be assigned. It will be automatically assigned to the first patch.

You need to log in before you can comment on or make changes to this bug.