Repository navigation
Add regression tests for known defects, tagged known-defect - #265
Open
sophiecarreras wants to merge 2 commits into
Open
sophiecarreras wants to merge 2 commits into
sophiecarreras wants to merge 2 commits into
Conversation
Tests only; no production code changes. Adds 21 test classes covering 56 findings. Tests for defects that are still present are tagged @category(KnownDefect.class). The default `test` task (and so `build` and CI) excludes that tag, so the build stays green. `./gradlew knownDefectTests` runs only the tagged tests and is expected to fail until each defect is fixed; remove the tag when a fix lands so the test joins the normal suite. Tests that pass today (fixed defects, guards, already-correct cases) run in the default suite and protect the current behaviour. Repository-health checks skip instead of failing when the tests are not run from a full checkout. Build change: buildSrc/src/main/kotlin/b2sdk.gradle.kts excludes the category from `test` and registers `knownDefectTests` for modules that contain the marker interface com.backblaze.b2.testing.KnownDefect. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
testGuardC18_closeReturnsPromptly failed intermittently (about 2 of 12 isolated runs): close() right after build() can land before the cleaner thread reaches its first wait. The guard now waits (bounded) for the thread to be parked first, so it only measures close() latency. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This branch has not been deployed
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.
Summary
Tests only. No production code changes.
Adds regression tests for 56 known findings, written against the current
master. Each test name carries its finding id (for exampletestFindingC21_...).@Category(KnownDefect.class). They are excluded from the defaulttesttask, so./gradlew buildand CI stay green../gradlew knownDefectTestsruns only those tests. It is expected to fail until the defects are fixed. When a fix lands, remove the tag so the test joins the normal suite.@Ignore; the exclusion is the visible category plus the task above.How to run
Default suite (known-defect tests excluded; 730 tests, all pass):
Known-defect tests only (57 tests; the task fails by design, every test fails today):
A class whose tests are all tagged reports "No tests found" if run with the plain
testtask; useknownDefectTestsfor it.What each status means
KnownDefect, run only inknownDefectTests, each fails for the reason the finding describes.Total 56 findings. The repository-health checks (changelog, README, security policy, one workflow command, one sample option) read repository files and are skipped, not failed, when run outside a full checkout.
Notes: a few tests read the sample source text because the CLI cannot run without a B2 account; these are source-pattern checks, not behaviour tests. One default-suite guard (C44) reflects JDK 11/17 behaviour and creates a sparse 2 GiB file that is deleted afterwards. The C18 guard waits (bounded) for the cleaner thread to park before timing
close(), so it is not timing-sensitive at startup, but it can still pass while the race it mentions exists.Existing tests are unchanged. Build change:
buildSrc/src/main/kotlin/b2sdk.gradle.kts(category exclusion and theknownDefectTeststask), plus a small marker interfacecom.backblaze.b2.testing.KnownDefectin the test source of core, httpclient and samples.The samples module had no tests before. No test needs credentials or network access beyond loopback.
🤖 Generated with Claude Code