multi: add itest to check race between channel_ready and update_add_htlc
This commit adds a new itest case to check the race condition found in issue #7401. In order to control the funding manager's state, a new dev config for the funding manager is introduced to specify a duration we should hold before processing remote node's channel_ready message. A new development config, `DevConfig` is introduced in `lncfg` and will only have effect if built with flag `integration`. This can also be extended for future integration tests if more dev-only flags are needed.
This commit is contained in:
7 files changed
+286
No files matched your search
@@ -0,0 +1,23 @@
|
||||
//go:build !integration
|
||||
|
||||
package lncfg
|
||||
|
||||
import "time"
|
||||
|
||||
// IsDevBuild returns a bool to indicate whether we are in a development
|
||||
// environment.
|
||||
//
|
||||
// NOTE: always return false here.
|
||||
func IsDevBuild() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// DevConfig specifies development configs used for production. This struct
|
||||
// should always remain empty.
|
||||
type DevConfig struct{}
|
||||
|
||||
// ChannelReadyWait returns the config value, which is always 0 for production
|
||||
// build.
|
||||
func (d *DevConfig) ChannelReadyWait() time.Duration {
|
||||
return 0
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
//go:build integration
|
||||
|
||||
package lncfg
|
||||
|
||||
import "time"
|
||||
|
||||
// IsDevBuild returns a bool to indicate whether we are in a development
|
||||
// environment.
|
||||
//
|
||||
// NOTE: always return true here.
|
||||
func IsDevBuild() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// DevConfig specifies configs used for integration tests. These configs can
|
||||
// only be used in tests and must NOT be exported for production usage.
|
||||
//
|
||||
//nolint:lll
|
||||
type DevConfig struct {
|
||||
ProcessChannelReadyWait time.Duration `long:"processchannelreadywait" description:"Time to sleep before processing remote node's channel_ready message."`
|
||||
}
|
||||
|
||||
// ChannelReadyWait returns the config value `ProcessChannelReadyWait`.
|
||||
func (d *DevConfig) ChannelReadyWait() time.Duration {
|
||||
return d.ProcessChannelReadyWait
|
||||
}
|
||||
Reference in new issue
Block a user