Repository navigation
test: cover the no-clobber publish guarantee and state it in the readme - #26
Merged
Merged
Conversation
Competing publications to one destination have exactly one winner, an existing destination and its sidecars are never touched, on every platform. The Android fallback for API 24 to 29 is internal now so a device test can force it on any API level. The readme states the guarantee per platform.
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.
What and why
#12 asked whether migrations on Android API 24–29 should get a strict mode that refuses to publish when the kernel cannot guarantee no-replace. Decision: keep the current behaviour and no strict mode. On API 24–29, Sealite publications are serialized against each other, across threads and processes. Unrelated code that writes the same path without the lock can still race the check-and-rename. A strict mode would be new public API for a case few apps have. This PR pins the guarantee with tests and states it precisely.
PublishNoClobberTest(commonTest, every platform). It exercisespublishWithoutReplacingdirectly:publishUnderLockgoes from private to internal.PublishAndroidTestgains three device tests that force the API 24–29 path on any API level: an existing target with sidecars, eight threads with one winner, and a dangling symbolic link.The known race with a non-cooperating writer on API 24–29 is documented, not asserted.
How it was tested
PublishNoClobberTest(5) andEncryptPlaintextTest(12) on the JVM (macOS)compileAndroidDeviceTestNot verified: the three new Android device tests were only compiled here. This PR's Android jobs run them for the first time.
Checklist
publishUnderLockisinternal)Stringor left unwipedCHANGELOG-relevant behaviour described aboveCloses #12