Skip to content

[Other] Stop is only stopped when the run's folder is really gone - #4442

Open
xvcezrqpbxtpzblrt wants to merge 1 commit into
Niko1221:mainfrom
xvcezrqpbxtpzblrt:host/timeskip-stop-027
Open

xvcezrqpbxtpzblrt wants to merge 1 commit into
Niko1221:mainfrom
xvcezrqpbxtpzblrt:host/timeskip-stop-027

Conversation

@xvcezrqpbxtpzblrt

Copy link
Copy Markdown
Contributor

Problem

Stopping a Time-skip run reported success even when the run's folder was still there. existsSync returns false on a permission error, so "could not be deleted" read as "deleted": the copies of the person's files stayed on disk while the interface said the run had stopped.

Result

  • The removal is verified: only ENOENT counts as gone. If the folder is still there after eight seconds, stop() raises, and the route answers with the error instead of a cheerful "stopped".
  • A folder that comes back after the first removal (a job still writing when it was ended) is removed again until it stays gone.

Validation

node --test tests/timeskip-real.test.mjs → 7 pass, 0 fail, three runs in a row (Windows). The stop case went from failing after 7.9 s to passing in about 0.9 s.

Limits

  • The end-to-end case is skipped when STRATA_HARNESS_DIR is not set; the pure logic and the code path are what the test covers here.
  • The folder can still be held by another program (an editor, an antivirus); then Stop now says so instead of pretending.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant