-
Notifications
You must be signed in to change notification settings - Fork 563
Clarify testing strategy, improve docs and CLI encoding, and add deprecation markers for test-only APIs #1689
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
peter-lawrey
wants to merge
33
commits into
adv/javadoc
Choose a base branch
from
adv/develop
base: adv/javadoc
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
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
…d exiting with status
…ability in multiple files
…oreTailer classes
… in 2027, to indicate they are only used in tests.
james-mcsherry
approved these changes
Nov 28, 2025
… lock acquisition and ensure proper pauser reset
|
# Conflicts: # README.adoc # docs/DISCLAIMER.adoc # docs/FAQ.adoc # docs/antora/modules/command-line/pages/command_line_tools.adoc # docs/antora/modules/demos/pages/demos.adoc # docs/utilities.adoc # src/main/docs/decision-log.adoc # src/main/docs/project-requirements.adoc # src/main/docs/security-review.adoc # src/main/java/net/openhft/chronicle/queue/impl/ExcerptContext.java # src/main/java/net/openhft/chronicle/queue/impl/single/namedtailer/IndexUpdaterFactory.java # src/main/java/net/openhft/chronicle/queue/internal/main/InternalBenchmarkMain.java # src/test/java/net/openhft/chronicle/queue/ChronicleQueueLatencyDistribution.java # src/test/java/net/openhft/chronicle/queue/ChronicleRollingIssueTest.java # src/test/java/net/openhft/chronicle/queue/CreateAtIndexTest.java # src/test/java/net/openhft/chronicle/queue/impl/single/stress/RollCycleMultiThreadStressDoubleBufferTest.java # src/test/java/net/openhft/chronicle/queue/impl/single/stress/RollCycleMultiThreadStressSharedWriterQueueTest.java # src/test/java/net/openhft/chronicle/queue/internal/reader/ChronicleReaderTest.java
…inary compatibility percentage in pom.xml
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.



Functional changes
Bump
net.openhft:third-party-bomfrom3.27ea5→3.27ea7.pom.xml.Standardise CLI help output on UTF-8 for Chronicle tools:
ChronicleHistoryReaderMain#printHelpAndExit(...)ChronicleReaderMain#printHelpAndExit(...)internal.writer.ChronicleWriterMain#printHelpAndExit(...)Standardise dump output on UTF-8 when writing to a file:
InternalDumpMain.dump(String)now createsPrintStream(FILE, "UTF-8"), with a guarded fallback if the charset is unavailable.Behavioural effect: CLI and dump output will now consistently use UTF-8 when redirected, avoiding platform-default encoding surprises.
More robust directory creation and warnings:
SingleChronicleQueueandSingleChronicleQueueBuilder:If
pathdoes not exist andmkdirs()fails (and the directory still does not exist), emit aJvm.warn()instead of failing silently.SingleChronicleQueueBuilder.builder(File, WireType):file.toString().equals("")to mean “current directory”, logs a warning, and normalises tonew File(".").metapath():metadata.cq4t.Behavioural effect: success paths are unchanged; misconfigured or unwritable directories now produce explicit warnings instead of silent failure.
Introduce a managed index-check flag in
QueueSystemProperties:New methods:
public static boolean checkIndex()– reads a cachedqueue.check.indexvalue.public static void setCheckIndex(boolean enabled)– test-only, allows overriding the flag.CHECK_INDEXis nowfinaland deprecated, backed bycheckIndex().All internal assertions have been switched from
QueueSystemProperties.CHECK_INDEXtoQueueSystemProperties.checkIndex().Behavioural effect: runtime semantics remain governed by
queue.check.index, but tests can toggle the behaviour safely without mutating a writable static.TableStoreWriteLocklock acquisition refactor:retryLockAcquisition(), with pauser reset in afinallyblock.TimeoutException, but pauser lifecycle is clearer and less error-prone.StoreTailerrobustness improvements:incrementIndex()now has an explicitdefaultbranch that throwsIllegalStateExceptionfor unsupportedTailerDirectionvalues.close()now usesisData()rather thanisPresent() && !isMetaData()when deciding to advance the index.StoreAppenderEOF and index checks:cycleHasEOF()uses a localwireLocaland guards theBytesreservation/release aroundendOfWire(...).QueueSystemProperties.checkIndex().(Behaviour unchanged; these are purely API signalling changes.)
Marked as deprecated, test-only or slated for removal in 2027:
ChronicleQueue:clear(),dump(OutputStream, long, long),lastIndexMSynced()andlastIndexMSynced(long).ExcerptTailer.readAfterReplicaAcknowledged().RollingChronicleQueue:storeForCycle(...),lastCycle(),nextCycle(...),countExcerpts(...).WireStore: multiple low-level methods (writePosition(long),moveToIndexForRead(...),moveToStartForRead(...),sequenceForPosition(...),setPositionForSequenceNumber(...),writeEOF(...),linearScanTo(...),moveToEndForRead(...),initIndex(...),dumpHeader(),dataVersion()).Indexing’s inspection methods (index counts, spacing, linear scan counters, etc.).Various builders and helpers (
SingleChronicleQueueBuilder.rollTime(LocalTime),queueOffsetSpec(...), ring-buffer tuning hooks,forceDirectoryListingRefreshIntervalMs(...),appenderListener(...),SingleChronicleQueue.chunkCount(),storeFileListener(),storeSupplier(),acquireAppender(),tableStoreGet(...),SingleChronicleQueueStore.dump(...)).Reader/HistoryReader/Reader factory and fluent helper methods now explicitly tagged as test-only.
Behavioural effect: none at runtime; callers now have clear guidance on which APIs are legacy or test-focused and scheduled for removal.
Non-functional changes
README / docs structure alignment:
src/main/docs/images/Queue_line.png.src/main/docs/.docs/system-properties.adoc).New testing strategy doc:
Added
src/main/docs/testing-strategy.adoc:project-requirements.adoc(QUEUE-FN-*,QUEUE-NF-*) anddecision-log.adoc.System properties and codegen diagnostics:
docs/system-properties.adoc:Adds entries for:
wire.generator.v2– enable v2 method-writer code generator.disableProxyCodegen– disable proxy fallback (fail fast when codegen breaks).docs/antora/modules/demos/pages/message-history.adoc:Failed to compile generated method writer – falling back to proxy method writer.General docs polish:
glossary.adoc, quick-start, roll-cycle and tailing docs).DumpMainAntora anchor fixed to#dumpmain.Test harness logging in
QueueTestCommon:Tracks recorded exceptions per test via
Jvm.recordExceptions(false).On test teardown, if a recorded exception message contains
"Failed to compile generated method writer":Logs a warning with:
java.version,wire.generator.v2anddisableProxyCodegenvalues,Benefit: makes intermittent codegen fallbacks on Java 8 significantly easier to diagnose without trawling full logs.
Encoding / charset correctness:
StandardCharsets.UTF_8andFiles.newInputStream(...)where we inspect/proc/self/maps.new String(byte[])withByteArrayOutputStream.toString()in tests.Busy-wait reductions:
while (...) ;loops in tests/benchmarks withJvm.nanoPause()orThread.yield()for more cooperative waiting.Refactoring & duplication removal in tests:
Extracted helpers for:
TestDeleteQueueFile.ChronicleReaderTest.CheckHalfWrittenMsgNotSeenByTailerTest.PartialUpdateTest.SingleChronicleQueueTest.Static analysis & style clean-ups:
assertFalseinstead of negatedassertTrue).assertSamewhere type identity is important.finalfields (e.g. histogram capacities, buffer sizes).Tests now express intent more clearly:
Assert.assertThrows(...)rather than manual try/catchfail()patterns.FileUtilTest.stateWindows).finalon temp folders, histograms, and other test fixtures.Overall, this PR does not change core queue behaviour but: