Skip to content

Commit

Permalink
logic: fix flakey logic test
Browse files Browse the repository at this point in the history
Since cockroachdb#53842 we write an initial liveness record with a zero timestamp.
This sometimes shows up as the following flake.

```
    logic.go:2283:

        testdata/logic_test/crdb_internal:356: SELECT node_id, regexp_replace(epoch::string, '^\d+$', '<epoch>') as epoch, regexp_replace(expiration, '^\d+\.\d+,\d+$', '<timestamp>') as expiration, draining, decommissioning, membership FROM crdb_internal.gossip_liveness WHERE node_id = 1
        expected:
            node_id  epoch  expiration    draining  decommissioning     membership
            1        <epoch>      <timestamp>   false     false               active

        but found (query options: "colnames") :
            node_id  epoch    expiration  draining  decommissioning  membership
            1        <epoch>  0,0         false     false            active
```

Release note: None
  • Loading branch information
ajwerner committed Feb 10, 2021
1 parent 39f954e commit 472321b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/sql/logictest/testdata/logic_test/crdb_internal
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,7 @@ node_id network address attrs locality server_version
1 tcp 127.0.0.1:<port> [] region=test,dc=dc1 <server_version>

query ITTBBT colnames
SELECT node_id, regexp_replace(epoch::string, '^\d+$', '<epoch>') as epoch, regexp_replace(expiration, '^\d+\.\d+,\d+$', '<timestamp>') as expiration, draining, decommissioning, membership FROM crdb_internal.gossip_liveness WHERE node_id = 1
SELECT node_id, regexp_replace(epoch::string, '^\d+$', '<epoch>') as epoch, regexp_replace(expiration, '^\d+(\.\d+)?,\d+$', '<timestamp>') as expiration, draining, decommissioning, membership FROM crdb_internal.gossip_liveness WHERE node_id = 1
----
node_id epoch expiration draining decommissioning membership
1 <epoch> <timestamp> false false active
Expand Down

0 comments on commit 472321b

Please sign in to comment.