Skip to content
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

Small fixes after recent PRs #1116

Merged
merged 2 commits into from
Sep 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ env:
GOPATH: /home/runner/work/go

GO_VERSION: '1.22.3'

LITD_ITEST_BRANCH: '0-19-staging'

jobs:
#######################
Expand Down Expand Up @@ -306,7 +308,11 @@ jobs:
uses: ./.github/actions/setup-go

- name: Clone Lit repository
run: git clone https://github.com/lightninglabs/lightning-terminal.git
uses: actions/checkout@v3
with:
repository: lightninglabs/lightning-terminal
ref: ${{ env.LITD_ITEST_BRANCH }}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not sure if related, but there's a tiny misbehavior according to an itest
https://github.com/lightninglabs/taproot-assets/actions/runs/10715230733/job/29710290030?pr=1116#step:4:52159

we get a "status completed" instead of "proofs transferred"

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, that seems to be a GitHub only flake... I ran this test a bunch of time locally and it never failed for me...
Going to re-run CI and just hope it goes away.

Copy link
Contributor

@gijswijs gijswijs Sep 5, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Man, this has been driving me bananas! I had something similar way back and never understood why that happens on GitHub.

The weird thing is that in my case when the test ran on Github it expected a different state than what the test was actually supposed to be expecting, and I think that's the case here as well, right?

The test expects SendStateWaitTxConf

AssertSendEvents(
t.t, scriptKey1Bytes, sendEvents,
tapfreighter.SendStateWaitTxConf,
tapfreighter.SendStateComplete,
)

But according to the run on GitHub the test expects SendStateTransferProofs which makes no sense whatsoever:
https://github.com/lightninglabs/taproot-assets/actions/runs/10715230733/job/29710290030?pr=1116#step:4:52158

Maybe an enumeration is off by one?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The enum values passed into AssertSendEvents() is a "from" and "to". So it's expecting all events from SendStateWaitTxConf in order up until SendStateComplete. And SendStateTransferProofs just happens to be an in-between one.
So I think it's a pure timing issue, perhaps because GitHub is slower than the local machine.

path: lightning-terminal

- name: Update go.mod to use the local Tap repository
working-directory: ./lightning-terminal
Expand All @@ -316,7 +322,7 @@ jobs:

- name: Install yarn
run: npm install -g yarn

- name: setup nodejs
uses: ./lightning-terminal/.github/actions/setup-node
with:
Expand Down
15 changes: 7 additions & 8 deletions itest/loadtest/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,16 +60,18 @@ type BitcoinConfig struct {

// PrometheusGatewayConfig defines exported config options for connecting to the
// Prometheus PushGateway.
//
//nolint:lll
type PrometheusGatewayConfig struct {
// nolint: lll
Enabled bool `long:"enabled" description:"Enable pushing metrics to Prometheus PushGateway"`
// nolint: lll
Enabled bool `long:"enabled" description:"Enable pushing metrics to Prometheus PushGateway"`
Host string `long:"host" description:"Prometheus PushGateway host address"`
Port int `long:"port" description:"Prometheus PushGateway port"`
PushURL string
}

// Config holds the main configuration for the performance testing binary.
//
//nolint:lll
type Config struct {
// TestCases is a comma separated list of test cases that will be
// executed.
Expand Down Expand Up @@ -111,8 +113,6 @@ type Config struct {

// PrometheusGateway is the configuration for the Prometheus
// PushGateway.
//
// nolint: lll
PrometheusGateway *PrometheusGatewayConfig `group:"prometheus-gateway" namespace:"prometheus-gateway" description:"Prometheus PushGateway configuration"`
}

Expand Down Expand Up @@ -185,9 +185,8 @@ func ValidateConfig(cfg Config) (*Config, error) {
gatewayPort := cfg.PrometheusGateway.Port

if gatewayHost == "" {
return nil, fmt.Errorf(
"gateway hostname may not be empty",
)
return nil, fmt.Errorf("gateway hostname may not be " +
"empty")
}

if gatewayPort == 0 {
Expand Down
20 changes: 12 additions & 8 deletions itest/loadtest/load_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,8 @@ func TestPerformance(t *testing.T) {
t.Fatalf("test case %v failed", tc.name)
}

// Calculate the test duration and push metrics if the test case succeeded.
// Calculate the test duration and push metrics if the test case
// succeeded.
if cfg.PrometheusGateway.Enabled {
duration := time.Since(startTime).Seconds()

Expand All @@ -93,19 +94,22 @@ func TestPerformance(t *testing.T) {
// Update the metric with the test duration.
testDuration.WithLabelValues(label).Set(duration)

t.Logf("Pushing testDuration %v with label %v to gateway", duration, label)
t.Logf("Pushing testDuration %v with label %v to "+
"gateway", duration, label)

// Create a new pusher to push the metrics.
pusher := push.New(cfg.PrometheusGateway.PushURL, "load_test").
Collector(testDuration)
pusher := push.New(
cfg.PrometheusGateway.PushURL, "load_test",
).Collector(testDuration)

// Push the metrics to Prometheus PushGateway.
if err := pusher.Add(); err != nil {
t.Logf("Could not push metrics to Prometheus PushGateway: %v",
err)
t.Logf("Could not push metrics to Prometheus "+
"PushGateway: %v", err)
} else {
t.Logf("Metrics pushed for test case '%s': duration = %v seconds",
tc.name, duration)
t.Logf("Metrics pushed for test case '%s': "+
"duration = %v seconds", tc.name,
duration)
}
}
}
Expand Down
Loading