Skip to content

Commit

Permalink
Misc Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
sappenin committed Nov 28, 2024
1 parent 00485ef commit 7287e06
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@ protected boolean ledgerGapsExistBetween(
return true; // Assume ledger gaps exist so this can be retried.
}

// Clamp the lastLedgerSequence to be at least as large as submittedLedgerSequence
// Ensure the lastLedgerSequence is (at least) as large as submittedLedgerSequence
if (FluentCompareTo.is(lastLedgerSequence).lessThan(submittedLedgerSequence)) {
lastLedgerSequence = submittedLedgerSequence;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
class AccountDeleteIT extends AbstractIT {

/**
* If any "real" testnet is being used (i.e., the enviornment specified is not a local one) then this test should not
* If any "real" testnet is being used (i.e., the environment specified is not a local one) then this test should not
* be run.
*
* @return {@code true} if test/dev/clio networks are the execution environment; {@code false} otherwise.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
public class IsFinalIT extends AbstractIT {

/**
* If any "real" testnet is being used (i.e., the enviornment specified is not a local one) then this test should not
* If any "real" testnet is being used (i.e., the environment specified is not a local one) then this test should not
* be run.
*
* @return {@code true} if test/dev/clio networks are the execution environment; {@code false} otherwise.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,11 @@
import java.time.Instant;
import java.util.Optional;

@EnabledIf(value = "shouldRun", disabledReason = "IsFinalIT only runs runs with local rippled nodes.")
@EnabledIf(value = "shouldRun", disabledReason = "PriceOracleIT only runs runs with local rippled nodes.")
public class PriceOracleIT extends AbstractIT {

/**
* If any "real" testnet is being used (i.e., the enviornment specified is not a local one) then this test should not
* If any "real" testnet is being used (i.e., the environment specified is not a local one) then this test should not
* be run.
*
* @return {@code true} if test/dev/clio networks are the execution environment; {@code false} otherwise.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -225,28 +225,24 @@ public void startLedgerAcceptor(final Duration acceptIntervalMillis) {
// rippled is run in standalone mode which means that ledgers won't automatically close. You have to manually
// advance the ledger using the "ledger_accept" method on the admin API. To mimic the behavior of a networked
// rippled, run a scheduled task to trigger the "ledger_accept" method.
// if (ledgerAcceptor.isTerminated()) { // <-- Some tests shutdown the acceptor, so don't check for that condition.
ledgerAcceptor = Executors.newScheduledThreadPool(1);
ledgerAcceptor.scheduleAtFixedRate(() -> LEDGER_ACCEPTOR.accept(this),
acceptIntervalMillis.toMillis(),
acceptIntervalMillis.toMillis(),
TimeUnit.MILLISECONDS
);
// }
// else {
// Do nothing; ledgerAcceptor is running or not yet started.
// }

waitForLedgerTimeToSync();
}

/**
* Stops the automated Ledger Acceptor, for example to control an integration test more finely.
*/
@SuppressWarnings({"all"})
public void stopLedgerAcceptor() {
try {
ledgerAcceptor.shutdown();
boolean result = ledgerAcceptor.awaitTermination(5, TimeUnit.SECONDS);
ledgerAcceptor.awaitTermination(5, TimeUnit.SECONDS);
} catch (InterruptedException e) {
throw new RuntimeException("Unable to stop ledger acceptor", e);
}
Expand Down

0 comments on commit 7287e06

Please sign in to comment.