Feature description
The plugin-contract reload scenario (#34, #35) proves load, unload, load: the second load restores the first load's surface and its callback still works. It never unloads again after that second load, and the ordinary scenario never unloads a reloaded plugin. A plugin whose unload is exact the first time but leaks after a reload therefore passes every case.
Related Code
tests/_support/plugin-contract/scenario.zsh in #35 (head 8799b23), lines 68-83: the reload scenario ends after the effect check, and its comment leaves exact unload to ordinary.
Reproduced on 8799b23 with a fixture whose unload removes its precmd hook only once, keyed on a _zunit_* flag the observer excludes (the device reload-stale uses):
reload noninteractive adv-second-unload: rc 0 (passes)
ordinary noninteractive adv-second-unload: rc 0 (passes)
The shipped fixture unloads exactly after a reload, so the check has a positive case today.
Additional Context
Found by the second independent review of #35 and left out of it by maintainer decision, so #35 merges as it stands with Refs #34. The organization testing standard asks that a separate clean-shell case load, unload and load again; it does not name the unload that follows, so this closes a gap the standard leaves open rather than one it requires.
Proposed change:
- In the
reload scenario, snapshot before the first load, then after the effect check unload again and assert plugin_restored against that first snapshot.
- Add a negative fixture whose unload leaks only after a reload; it must fail
reload and pass ordinary.
- Reword the scenario comment that leaves exact unload to
ordinary.
Acceptance criteria:
- A fixture whose post-reload unload leaks fails the
reload case, and the shipped fixture passes it.
./zunit --tap tests passes on the native job.
Self-service
Have you read the Contributing Guidelines?
Are you familiar with the Contributor Covenant Code of Conduct?
Feature description
The plugin-contract
reloadscenario (#34, #35) proves load, unload, load: the second load restores the first load's surface and its callback still works. It never unloads again after that second load, and theordinaryscenario never unloads a reloaded plugin. A plugin whose unload is exact the first time but leaks after a reload therefore passes every case.Related Code
tests/_support/plugin-contract/scenario.zshin #35 (head 8799b23), lines 68-83: thereloadscenario ends after the effect check, and its comment leaves exact unload toordinary.Reproduced on 8799b23 with a fixture whose unload removes its
precmdhook only once, keyed on a_zunit_*flag the observer excludes (the devicereload-staleuses):The shipped fixture unloads exactly after a reload, so the check has a positive case today.
Additional Context
Found by the second independent review of #35 and left out of it by maintainer decision, so #35 merges as it stands with
Refs #34. The organization testing standard asks that a separate clean-shell case load, unload and load again; it does not name the unload that follows, so this closes a gap the standard leaves open rather than one it requires.Proposed change:
reloadscenario, snapshot before the first load, then after the effect check unload again and assertplugin_restoredagainst that first snapshot.reloadand passordinary.ordinary.Acceptance criteria:
reloadcase, and the shipped fixture passes it../zunit --tap testspasses on the native job.Self-service
Have you read the Contributing Guidelines?
Are you familiar with the Contributor Covenant Code of Conduct?