Skip to content

Commit

Permalink
fix TestRequiredProtocolVersionChangeAndHalt (#150)
Browse files Browse the repository at this point in the history
  • Loading branch information
syntrust authored Jan 4, 2025
1 parent fc01edd commit 7901cae
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion op-e2e/system/runcfg/protocol_versions_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,13 @@ func TestRequiredProtocolVersionChangeAndHalt(t *testing.T) {
_, err = retry.Do(context.Background(), 10, retry.Fixed(time.Second*10), func() (struct{}, error) {
ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
defer cancel()
available := client.IsURLAvailable(ctx, sys.NodeEndpoint("verifier").(endpoint.HttpRPC).HttpRPC())
url := sys.NodeEndpoint("verifier").(endpoint.HttpRPC).HttpRPC()
// The URL of the verifier op-geth becomes empty after it is stopped.
// In this case, IsURLAvailable() returns an incorrect value when port 80 happens to be occupied by another process.
if url == "http://" {
return struct{}{}, nil
}
available := client.IsURLAvailable(ctx, url)
if !available && ctx.Err() == nil { // waiting for client to stop responding to RPC requests (slow dials with timeout don't count)
return struct{}{}, nil
}
Expand Down

0 comments on commit 7901cae

Please sign in to comment.