Documentation ¶
Index ¶
- func NewDependencyBlockResumeJobDownloadUntilTimeout() modules.Dependencies
- func NewDependencyCustomResolver(lookupIP func(string) ([]net.IP, error)) modules.Dependencies
- func NewHostMaxEphemeralAccountRiskReached(duration time.Duration) modules.Dependencies
- type DependencyAddLatency
- type DependencyBlockResumeJobDownloadUntilTimeout
- type DependencyBlockScan
- type DependencyDisableAsyncStartup
- type DependencyDisableAsyncUnlock
- type DependencyDisableAutoOnline
- type DependencyDisableCloseUploadEntry
- type DependencyDisableContractRecovery
- type DependencyDisableRecoveryStatusReset
- type DependencyDisableRenewal
- type DependencyDisableRepairAndHealthLoops
- type DependencyDisableUploadGougingCheck
- type DependencyDoNotAcceptTxnSet
- type DependencyFailUploadStreamFromReader
- type DependencyHighMinHostScore
- type DependencyInterruptAfterNCalls
- type DependencyInterruptOnceOnKeyword
- func NewDependencyHostDiskTrouble() *DependencyInterruptOnceOnKeyword
- func NewDependencyInterruptContractSaveToDiskAfterDeletion() *DependencyInterruptOnceOnKeyword
- func NewDependencyInterruptDownloadAfterSendingRevision() *DependencyInterruptOnceOnKeyword
- func NewDependencyInterruptDownloadBeforeSendingRevision() *DependencyInterruptOnceOnKeyword
- func NewDependencyInterruptUploadAfterSendingRevision() *DependencyInterruptOnceOnKeyword
- func NewDependencyInterruptUploadBeforeSendingRevision() *DependencyInterruptOnceOnKeyword
- type DependencyLowFundsFormationFail
- type DependencyLowFundsRefreshFail
- type DependencyLowFundsRenewalFail
- type DependencyPostponeWritePiecesRecovery
- type DependencyRenewWithoutClear
- type DependencySkipDeleteContractAfterRenewal
- type DependencyTimeoutProjectDownloadByRoot
- type DependencyToggleWatchdogBroadcast
- type DependencyUnsyncedConsensus
- type DependencyWithDisableAndEnable
- type HostExpireEphemeralAccounts
- type HostRejectAllSessionLocks
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewDependencyBlockResumeJobDownloadUntilTimeout ¶ added in v1.4.5
func NewDependencyBlockResumeJobDownloadUntilTimeout() modules.Dependencies
NewDependencyBlockResumeJobDownloadUntilTimeout blocks in managedResumeJobDownloadByRoot until the timeout for the download project is reached.
func NewDependencyCustomResolver ¶
NewDependencyCustomResolver creates a dependency from a given lookupIP method which returns a custom resolver that uses the specified lookupIP method to resolve hostnames.
func NewHostMaxEphemeralAccountRiskReached ¶ added in v1.4.2
func NewHostMaxEphemeralAccountRiskReached(duration time.Duration) modules.Dependencies
NewHostMaxEphemeralAccountRiskReached is a dependency injection for the host that will ensure the ephemeral account max saved delta is reached by persisting with a set latency.
Types ¶
type DependencyAddLatency ¶ added in v1.4.2
type DependencyAddLatency struct { modules.ProductionDependencies // contains filtered or unexported fields }
DependencyAddLatency will introduce a latency by sleeping for the specified duration if the argument passed to Distrupt equals str.
func (*DependencyAddLatency) Disrupt ¶ added in v1.4.2
func (d *DependencyAddLatency) Disrupt(s string) bool
Disrupt will sleep for the specified duration if the correct string is provided.
type DependencyBlockResumeJobDownloadUntilTimeout ¶ added in v1.4.5
type DependencyBlockResumeJobDownloadUntilTimeout struct { DependencyTimeoutProjectDownloadByRoot // contains filtered or unexported fields }
DependencyBlockResumeJobDownloadUntilTimeout blocks in managedResumeJobDownloadByRoot until the timeout for the download project is reached.
func (*DependencyBlockResumeJobDownloadUntilTimeout) Disrupt ¶ added in v1.4.5
func (d *DependencyBlockResumeJobDownloadUntilTimeout) Disrupt(s string) bool
Disrupt returns true if the correct string is provided.
type DependencyBlockScan ¶
type DependencyBlockScan struct { modules.ProductionDependencies // contains filtered or unexported fields }
DependencyBlockScan blocks the scan progress of the hostdb until Scan is called on the dependency.
func (*DependencyBlockScan) Disrupt ¶
func (d *DependencyBlockScan) Disrupt(s string) bool
Disrupt will block the scan progress of the hostdb. The scan can be started by calling Scan on the dependency.
func (*DependencyBlockScan) Scan ¶
func (d *DependencyBlockScan) Scan()
Scan resumes the blocked scan.
type DependencyDisableAsyncStartup ¶ added in v1.4.2
type DependencyDisableAsyncStartup struct {
modules.ProductionDependencies
}
DependencyDisableAsyncStartup prevents the async part of a module's creation from being executed.
func (*DependencyDisableAsyncStartup) Disrupt ¶ added in v1.4.2
func (d *DependencyDisableAsyncStartup) Disrupt(s string) bool
Disrupt returns true if the correct string is provided.
type DependencyDisableAsyncUnlock ¶ added in v1.4.2
type DependencyDisableAsyncUnlock struct {
modules.ProductionDependencies
}
DependencyDisableAsyncUnlock will prevent the wallet to catch up to consensus after unlocking it.
func (*DependencyDisableAsyncUnlock) Disrupt ¶ added in v1.4.2
func (d *DependencyDisableAsyncUnlock) Disrupt(s string) bool
Disrupt will prevent the wallet to catch up to consensus after unlocking it.
type DependencyDisableAutoOnline ¶ added in v1.4.2
type DependencyDisableAutoOnline struct {
modules.ProductionDependencies
}
DependencyDisableAutoOnline will disable the gateway always being online during testing and dev builds and instead apply the same rules which are used in production builds.
func (*DependencyDisableAutoOnline) Disrupt ¶ added in v1.4.2
func (d *DependencyDisableAutoOnline) Disrupt(s string) bool
Disrupt returns true if the correct string is provided.
type DependencyDisableCloseUploadEntry ¶
type DependencyDisableCloseUploadEntry struct {
modules.ProductionDependencies
}
DependencyDisableCloseUploadEntry prevents SiaFileEntries in the upload code from being closed.
func (*DependencyDisableCloseUploadEntry) Disrupt ¶
func (d *DependencyDisableCloseUploadEntry) Disrupt(s string) bool
Disrupt prevents SiafileEntries in the upload code from being closed.
type DependencyDisableContractRecovery ¶
type DependencyDisableContractRecovery struct {
modules.ProductionDependencies
}
DependencyDisableContractRecovery prevents recoverable contracts from being recovered in threadedContractMaintenance.
func (*DependencyDisableContractRecovery) Disrupt ¶
func (d *DependencyDisableContractRecovery) Disrupt(s string) bool
Disrupt prevents contracts from being recovered in threadedContractMaintenance.
type DependencyDisableRecoveryStatusReset ¶
type DependencyDisableRecoveryStatusReset struct {
modules.ProductionDependencies
}
DependencyDisableRecoveryStatusReset prevents the fields scanInProgress and atomicRecoveryScanHeight from being reset after the scan is done.
func (*DependencyDisableRecoveryStatusReset) Disrupt ¶
func (d *DependencyDisableRecoveryStatusReset) Disrupt(s string) bool
Disrupt will prevent the fields scanInProgress and atomicRecoveryScanHeight from being reset after the scan is done and also prevent automatic contract recovery scans from being triggered.
type DependencyDisableRenewal ¶
type DependencyDisableRenewal struct {
modules.ProductionDependencies
}
DependencyDisableRenewal prevents contracts from being renewed.
func (*DependencyDisableRenewal) Disrupt ¶
func (d *DependencyDisableRenewal) Disrupt(s string) bool
Disrupt will prevent contracts from being renewed.
type DependencyDisableRepairAndHealthLoops ¶
type DependencyDisableRepairAndHealthLoops struct {
modules.ProductionDependencies
}
DependencyDisableRepairAndHealthLoops prevents the background loops for repairs and updating directory metadata from running. This includes threadedUploadAndRepair, threadedStuckLoop, and threadedUpdateRenterHealth
func (*DependencyDisableRepairAndHealthLoops) Disrupt ¶
func (d *DependencyDisableRepairAndHealthLoops) Disrupt(s string) bool
Disrupt will prevent the repair and health loops from running
type DependencyDisableUploadGougingCheck ¶ added in v1.4.2
type DependencyDisableUploadGougingCheck struct {
modules.ProductionDependencies
}
DependencyDisableUploadGougingCheck ignores the upload gouging check
func (*DependencyDisableUploadGougingCheck) Disrupt ¶ added in v1.4.2
func (d *DependencyDisableUploadGougingCheck) Disrupt(s string) bool
Disrupt will prevent the uploads to fail due to upload gouging
type DependencyDoNotAcceptTxnSet ¶ added in v1.4.3
type DependencyDoNotAcceptTxnSet struct {
modules.ProductionDependencies
}
DependencyDoNotAcceptTxnSet will not accept a transaction set.
func (*DependencyDoNotAcceptTxnSet) Disrupt ¶ added in v1.4.3
func (d *DependencyDoNotAcceptTxnSet) Disrupt(s string) bool
Disrupt returns true if the correct string is provided.
type DependencyFailUploadStreamFromReader ¶ added in v1.4.2
type DependencyFailUploadStreamFromReader struct {
modules.ProductionDependencies
}
DependencyFailUploadStreamFromReader prevents SiaFileEntries in the upload code from being closed.
func (*DependencyFailUploadStreamFromReader) Disrupt ¶ added in v1.4.2
func (d *DependencyFailUploadStreamFromReader) Disrupt(s string) bool
Disrupt prevents SiafileEntries in the upload code from being closed.
type DependencyHighMinHostScore ¶ added in v1.4.2
type DependencyHighMinHostScore struct { modules.ProductionDependencies // contains filtered or unexported fields }
DependencyHighMinHostScore returns high minimum-allowed host score for GFR to help simulate churn related to low scoring hosts.
func (*DependencyHighMinHostScore) Disrupt ¶ added in v1.4.2
func (d *DependencyHighMinHostScore) Disrupt(s string) bool
Disrupt causes a high min-score for GFR to be returned.
func (*DependencyHighMinHostScore) ForceHighMinHostScore ¶ added in v1.4.2
func (d *DependencyHighMinHostScore) ForceHighMinHostScore(force bool)
ForceHighMinHostScore causes the dependency disrupt to activate.
type DependencyInterruptAfterNCalls ¶
type DependencyInterruptAfterNCalls struct { DependencyInterruptOnceOnKeyword // contains filtered or unexported fields }
DependencyInterruptAfterNCalls is a generic dependency that behaves the same way as DependencyInterruptOnceOnKeyword, expect that after calling "Fail", "Disrupt" needs to be called n times for the actual disrupt to happen.
func NewDependencyDisruptUploadStream ¶
func NewDependencyDisruptUploadStream(numChunks int) *DependencyInterruptAfterNCalls
NewDependencyDisruptUploadStream creates a new dependency that closes the reader used for upload streaming to simulate failing connection after numChunks uploaded chunks.
func (*DependencyInterruptAfterNCalls) Disrupt ¶
func (d *DependencyInterruptAfterNCalls) Disrupt(s string) bool
Disrupt returns true if the correct string is provided, if the flag was set to true by calling fail on the dependency and if Disrupt has been called n times since fail was called.
type DependencyInterruptOnceOnKeyword ¶
type DependencyInterruptOnceOnKeyword struct { modules.ProductionDependencies // contains filtered or unexported fields }
DependencyInterruptOnceOnKeyword is a generic dependency that interrupts the flow of the program if the argument passed to Disrupt equals str and if f was set to true by calling Fail.
func NewDependencyHostDiskTrouble ¶ added in v1.4.2
func NewDependencyHostDiskTrouble() *DependencyInterruptOnceOnKeyword
NewDependencyHostDiskTrouble creates a new dependency that disrupts storage folder operations due to disk trouble
func NewDependencyInterruptContractSaveToDiskAfterDeletion ¶
func NewDependencyInterruptContractSaveToDiskAfterDeletion() *DependencyInterruptOnceOnKeyword
NewDependencyInterruptContractSaveToDiskAfterDeletion creates a new dependency that interrupts the contract being saved to disk after being removed from static contracts
func NewDependencyInterruptDownloadAfterSendingRevision ¶
func NewDependencyInterruptDownloadAfterSendingRevision() *DependencyInterruptOnceOnKeyword
NewDependencyInterruptDownloadAfterSendingRevision creates a new dependency that interrupts the download on the renter side right after receiving the signed revision from the host.
func NewDependencyInterruptDownloadBeforeSendingRevision ¶
func NewDependencyInterruptDownloadBeforeSendingRevision() *DependencyInterruptOnceOnKeyword
NewDependencyInterruptDownloadBeforeSendingRevision creates a new dependency that interrupts the download on the renter side before sending the signed revision to the host.
func NewDependencyInterruptUploadAfterSendingRevision ¶
func NewDependencyInterruptUploadAfterSendingRevision() *DependencyInterruptOnceOnKeyword
NewDependencyInterruptUploadAfterSendingRevision creates a new dependency that interrupts the upload on the renter side right after receiving the signed revision from the host.
func NewDependencyInterruptUploadBeforeSendingRevision ¶
func NewDependencyInterruptUploadBeforeSendingRevision() *DependencyInterruptOnceOnKeyword
NewDependencyInterruptUploadBeforeSendingRevision creates a new dependency that interrupts the upload on the renter side before sending the signed revision to the host.
func (*DependencyInterruptOnceOnKeyword) Disable ¶
func (d *DependencyInterruptOnceOnKeyword) Disable()
Disable sets the flag to false to make sure that the dependency won't fail.
func (*DependencyInterruptOnceOnKeyword) Disrupt ¶
func (d *DependencyInterruptOnceOnKeyword) Disrupt(s string) bool
Disrupt returns true if the correct string is provided and if the flag was set to true by calling fail on the dependency beforehand. After simulating a crash the flag will be set to false and fail has to be called again for another disruption.
func (*DependencyInterruptOnceOnKeyword) Fail ¶
func (d *DependencyInterruptOnceOnKeyword) Fail()
Fail causes the next call to Disrupt to return true if the correct string is provided.
type DependencyLowFundsFormationFail ¶ added in v1.4.2
type DependencyLowFundsFormationFail struct {
modules.ProductionDependencies
}
DependencyLowFundsFormationFail will cause contract formation to fail due to low funds in the allowance.
func (*DependencyLowFundsFormationFail) Disrupt ¶ added in v1.4.2
func (d *DependencyLowFundsFormationFail) Disrupt(s string) bool
Disrupt causes contract formation to fail due to low allowance funds.
type DependencyLowFundsRefreshFail ¶ added in v1.4.2
type DependencyLowFundsRefreshFail struct {
modules.ProductionDependencies
}
DependencyLowFundsRefreshFail will cause contract renewal to fail due to low funds in the allowance.
func (*DependencyLowFundsRefreshFail) Disrupt ¶ added in v1.4.2
func (d *DependencyLowFundsRefreshFail) Disrupt(s string) bool
Disrupt causes contract renewal to fail due to low allowance funds.
type DependencyLowFundsRenewalFail ¶ added in v1.4.2
type DependencyLowFundsRenewalFail struct {
modules.ProductionDependencies
}
DependencyLowFundsRenewalFail will cause contract renewal to fail due to low funds in the allowance.
func (*DependencyLowFundsRenewalFail) Disrupt ¶ added in v1.4.2
func (d *DependencyLowFundsRenewalFail) Disrupt(s string) bool
Disrupt causes contract renewal to fail due to low allowance funds.
type DependencyPostponeWritePiecesRecovery ¶ added in v1.4.2
type DependencyPostponeWritePiecesRecovery struct {
modules.ProductionDependencies
}
DependencyPostponeWritePiecesRecovery adds a random sleep in the WritePieces method between calling Seek and Recover as a regression test for randomly corrupting downloads.
func (*DependencyPostponeWritePiecesRecovery) Disrupt ¶ added in v1.4.2
func (d *DependencyPostponeWritePiecesRecovery) Disrupt(s string) bool
Disrupt returns true if the correct string is provided.
type DependencyRenewWithoutClear ¶ added in v1.4.4
type DependencyRenewWithoutClear struct {
modules.ProductionDependencies
}
DependencyRenewWithoutClear will force contracts to be renewed without clearing their contents.
func (*DependencyRenewWithoutClear) Disrupt ¶ added in v1.4.4
func (d *DependencyRenewWithoutClear) Disrupt(s string) bool
Disrupt causes contract renewal to not clear the contents of a contract.
type DependencySkipDeleteContractAfterRenewal ¶ added in v1.4.5
type DependencySkipDeleteContractAfterRenewal struct {
modules.ProductionDependencies
}
DependencySkipDeleteContractAfterRenewal prevents the old contract from being deleted after a renewal.
func (*DependencySkipDeleteContractAfterRenewal) Disrupt ¶ added in v1.4.5
func (d *DependencySkipDeleteContractAfterRenewal) Disrupt(s string) bool
Disrupt returns true if the correct string is provided.
type DependencyTimeoutProjectDownloadByRoot ¶ added in v1.4.4
type DependencyTimeoutProjectDownloadByRoot struct {
modules.ProductionDependencies
}
DependencyTimeoutProjectDownloadByRoot immediately times out projects that try to download a sector by its root.
func (*DependencyTimeoutProjectDownloadByRoot) Disrupt ¶ added in v1.4.4
func (d *DependencyTimeoutProjectDownloadByRoot) Disrupt(s string) bool
Disrupt forces an immediate timeout for DownloadByRoot projects.
type DependencyToggleWatchdogBroadcast ¶ added in v1.4.2
type DependencyToggleWatchdogBroadcast struct { modules.ProductionDependencies // contains filtered or unexported fields }
DependencyToggleWatchdogBroadcast can toggle the watchdog's ability to broadcast transactions.
func (*DependencyToggleWatchdogBroadcast) DisableWatchdogBroadcast ¶ added in v1.4.2
func (d *DependencyToggleWatchdogBroadcast) DisableWatchdogBroadcast(disable bool)
DisableWatchdogBroadcast will prevent the watchdog from broadcating transactions.
func (*DependencyToggleWatchdogBroadcast) Disrupt ¶ added in v1.4.2
func (d *DependencyToggleWatchdogBroadcast) Disrupt(s string) bool
Disrupt will prevent watchdog from rebroadcasting transactions when broadcasting is disabled.
type DependencyUnsyncedConsensus ¶
type DependencyUnsyncedConsensus struct {
modules.ProductionDependencies
}
DependencyUnsyncedConsensus makes the consensus set appear unsynced
func (*DependencyUnsyncedConsensus) Disrupt ¶
func (d *DependencyUnsyncedConsensus) Disrupt(s string) bool
Disrupt will prevent the consensus set from appearing synced
type DependencyWithDisableAndEnable ¶ added in v1.4.2
type DependencyWithDisableAndEnable struct { modules.ProductionDependencies // contains filtered or unexported fields }
DependencyWithDisableAndEnable adds the ability to disable the dependency
func NewDependencyContractRenewalFail ¶ added in v1.4.2
func NewDependencyContractRenewalFail() *DependencyWithDisableAndEnable
NewDependencyContractRenewalFail creates a new dependency that simulates getting an error while renewing a contract.
func (*DependencyWithDisableAndEnable) Disable ¶ added in v1.4.2
func (d *DependencyWithDisableAndEnable) Disable()
Disable sets the flag to true to make sure that the dependency will fail.
func (*DependencyWithDisableAndEnable) Disrupt ¶ added in v1.4.2
func (d *DependencyWithDisableAndEnable) Disrupt(s string) bool
Disrupt returns true if the correct string is provided and the dependency has not been disabled.
func (*DependencyWithDisableAndEnable) Enable ¶ added in v1.4.2
func (d *DependencyWithDisableAndEnable) Enable()
Enable sets the flag to false to make sure that the dependency won't fail.
type HostExpireEphemeralAccounts ¶ added in v1.4.2
type HostExpireEphemeralAccounts struct {
modules.ProductionDependencies
}
HostExpireEphemeralAccounts is a dependency injection for the host that will expire ephemeral accounts as soon as they get pruned
func (*HostExpireEphemeralAccounts) Disrupt ¶ added in v1.4.2
func (d *HostExpireEphemeralAccounts) Disrupt(s string) bool
Disrupt will interpret a signal from the host and tell the host to force expire all ephemeral accounts on the next prune cycle
type HostRejectAllSessionLocks ¶ added in v1.4.2
type HostRejectAllSessionLocks struct { modules.ProductionDependencies // contains filtered or unexported fields }
HostRejectAllSessionLocks is a dependency injection for the host that will cause the host to reject all contracts as though they do not exist.
func (*HostRejectAllSessionLocks) Disrupt ¶ added in v1.4.2
func (d *HostRejectAllSessionLocks) Disrupt(s string) bool
Disrupt will interpret a signal from the host and tell the host to pretend it has no record of the contract.
func (*HostRejectAllSessionLocks) StartRejectingLocks ¶ added in v1.4.3
func (d *HostRejectAllSessionLocks) StartRejectingLocks()
StartRejectingLocks will activate the dependency.