feat: Add migration utilities and fix flaky job tests #1332
+672
−85
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
migrate.pydelay=-1for immediate job schedulingMigration utilities added:
analyze_columns(): Identify columns needing type labels in commentsmigrate_columns(): Add core type markers (:int32:,:<blob>:, etc.) to column commentsNATIVE_TO_CORE_TYPEmapping for MySQL native → DataJoint core type conversionAlso adds placeholder stubs for Phase 3-4 migration functions:
migrate_external(): For external storage migration (blob, attach)migrate_filepath(): For filepath attribute migrationfinalize_migration(): For Phase 4 finalizationFlaky test fix:
The tests
test_sigint,test_sigterm,test_suppress_dj_errors, andtest_populate_exclude_error_and_ignore_jobswere flaky due to a race condition: jobs created withscheduled_time=NOW(3)might not pass thescheduled_time <= NOW(3)check if checked in the same millisecond.Fixed by using
delay=-1in auto-refresh duringpopulate(), ensuring jobs are scheduled 1 second in the past and immediately schedulable.Test plan
🤖 Generated with Claude Code