Skip to content

Conversation

@sl-at-ibm
Copy link

It seems that if the interface admits ipv6, calling the URL "localhost" resolves to ipv6, preventing the integration testing to run against a local Data API + HCD. On my system this is what I see:

$> scripts/test.ts -f 'integration.'  -local


Running prelude.test.ts
  1) "before all" hook in "{root}"                                                                              

  0 passing (9ms)
  1 failing

  1) "before all" hook in "{root}":
     Error: connect ECONNREFUSED ::1:8181
      at __node_internal_captureLargerStackTrace (node:internal/errors:496:5)
      at __node_internal_exceptionWithHostPort (node:internal/errors:671:12)
      at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1555:16)
      at TCPConnectWrap.callbackTrampoline (node:internal/async_hooks:128:17)

This PR simply uses the explicit format for an ipv4 address. And indeed I can run integration tests.

With this change, the ITs start all right:

$> scripts/test.ts -f 'integration.'  -local


Running prelude.test.ts
creating keyspace 'other_keyspace'
  (ASTRA) integration.administration.astra-admin                                                                
    - should not stop you from creating an AstraAdmin without a token
    findAvailableRegions
      - should work

  integration.administration.db-admin
    ✔ (LONG) works (2236ms)
    ✔ should findEmbeddingProviders
    - (ASTRA) should timeout

[etc, etc...]

(also in the .env one should prefer this notation, I think - but that file is gitignored and I think if not defined the scripts/test.ts is the default).

Note: I should have ipv6 enabled indeed:

$> ip addr
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host noprefixroute 
       valid_lft forever preferred_lft forever

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant