fix: make every down/0 runnable, and pin the generator that stopped writing them - #371
Merged
Conversation
…riting them rebar3_kura emitted every drop_table before every drop_index, and dropping a table already drops its indexes, so two of asobi's own migrations could not roll back: create_player_identities and create_ops_audit_entries each drop a table and then drop an index of it, which raises 42704 part way through. Taure/rebar3_kura#43 fixed the generator in v0.16.1; this pins it and corrects the two files it wrote before. Editing a generated migration rather than regenerating it is deliberate: the generator only ever emits a new file, and these are applied everywhere. down/0 is read at rollback time only, so correcting it changes no deployed database. asobi_migrations_tests walks every migration in the application and fails if a down/0 drops an index of a table it also drops, because nothing else would notice - down/0 runs on a rollback and nowhere else. Against the previous two files it fails twice.
🟡 Code Coverage — 75%6537 of 8718 lines covered. |
This was referenced Aug 5, 2026
Closed
Taure
added a commit
that referenced
this pull request
Aug 5, 2026
This was referenced Aug 5, 2026
Taure
added a commit
that referenced
this pull request
Aug 5, 2026
… group (#381) Closes #376. asobi_match_server:waiting/3 stops with {shutdown, timeout} after ?WAITING_TIMEOUT - sixty seconds - and five test modules started one with start_link and never unlinked it. asobi_match_server_tests starts 49 and stops 36, so thirteen linked processes were left sitting in `waiting` on every run. A minute later each one exits {shutdown, timeout}, and the link carries that into the eunit process running at that moment - which is some unrelated group, usually a property module, because those run last. eunit reports it as `*unexpected termination of test process* ::{shutdown,timeout}` with `Failed: 0` and `undefined` for a name, since nothing failed: a group was killed from outside. That is every symptom in #376. It explains the alternating victim, the sub-second gap between a module header and the kill, the zero failures, and why no timeout in the tree was short enough to account for it - the timer that fired belonged to a process nobody was looking at. It is CI-only because it is a race with total run time: the leak has to still be linked sixty seconds later, and a slower runner keeps the suite alive long enough for the timer to land inside a later module. Nothing about #372 caused it; that PR added enough test time to make the landing more likely. A bisect probe at #371, the supposed last green, fails too. Unlink at every start_link site, matching what asobi_bot_presence_tests already did. The three fixes in #378 were all real and none of them was this.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Closes the last open item from the
asobi_questsgap report (section 11), which was filed upstream as Taure/rebar3_kura#43.What was wrong
rebar3_kuraemitted everydrop_tablebefore everydrop_index. Dropping a table already drops its indexes, so thedrop_indexthat followed raised42704and the rollback stopped half way:Two of asobi's own migrations were written that way and could not roll back:
m20260330174743_create_player_identities- dropsplayer_identities, then two of its indexesm20260804063533_create_ops_audit_entries- dropsops_audit_entries, then all three of its indexesWhat is here
rebar3_kurav0.16.0 -> v0.16.1, which is the fix upstream: index down-ops for a table created in the same migration are no longer emitted at all.down/0is read at rollback time and nowhere else, so this changes no deployed database.asobi_migrations_testswalks every migration in the application and fails if adown/0drops an index of a table it also drops. Nothing else would have noticed:down/0runs on a rollback and never in CI. Against the two files as they were, it fails twice.Checks
rebar3 fmt --check,xrefandeunit(1551 tests, 0 failures) all clean locally.