File tree Expand file tree Collapse file tree 2 files changed +61
-1
lines changed
Expand file tree Collapse file tree 2 files changed +61
-1
lines changed Original file line number Diff line number Diff line change @@ -26,6 +26,9 @@ concurrency:
2626 group : ${{ github.workflow }}-${{ github.ref }}
2727 cancel-in-progress : true
2828
29+ env :
30+ MAELSTROM_VERSION : " 0.2.3"
31+
2932jobs :
3033
3134 build :
@@ -108,3 +111,45 @@ jobs:
108111 run : kubectl -n oxia logs -l app.kubernetes.io/component=coordinator
109112 - name : Print perf logs
110113 run : kubectl -n oxia logs perf
114+
115+ maelstrom :
116+ name : Maelstrom
117+ runs-on : ubuntu-latest
118+ steps :
119+ - uses : actions/checkout@v3
120+
121+ - name : Set up Go
122+ uses : actions/setup-go@v3
123+ with :
124+ go-version : 1.19
125+
126+ - name : Set up JDK 17
127+ uses : actions/setup-java@v3
128+ with :
129+ distribution : temurin
130+ java-version : 17
131+
132+ - name : Install Gnuplot
133+ run : |
134+ sudo apt-get install -y gnuplot
135+
136+ - run : make
137+ - run : make maelstrom
138+
139+ - name : Download Maelstrom
140+ run : |
141+ curl -O -L https://github.com/jepsen-io/maelstrom/releases/download/v${MAELSTROM_VERSION}/maelstrom.tar.bz2
142+ tar xf maelstrom.tar.bz2
143+
144+ - name : Run Maelstrom test
145+ run : |
146+ cd maelstrom
147+ ./maelstrom test -w lin-kv --bin ../bin/oxia-maelstrom \
148+ --time-limit 60 --concurrency 2n --latency 10 --latency-dist uniform
149+
150+ - name : Upload test results
151+ uses : actions/upload-artifact@v3
152+ if : failure()
153+ with :
154+ name : maelstrom-result
155+ path : maelstrom/store
Original file line number Diff line number Diff line change @@ -17,6 +17,7 @@ package main
1717import (
1818 "bufio"
1919 "fmt"
20+ "github.com/pkg/errors"
2021 "github.com/rs/zerolog"
2122 "github.com/rs/zerolog/log"
2223 "github.com/spf13/cobra"
@@ -64,6 +65,16 @@ var thisNode string
6465var allNodes []string
6566
6667func handleInit (scanner * bufio.Scanner ) {
68+ for {
69+ if err := receiveInit (scanner ); err != nil {
70+ continue
71+ }
72+
73+ return
74+ }
75+ }
76+
77+ func receiveInit (scanner * bufio.Scanner ) error {
6778 if ! scanner .Scan () {
6879 log .Fatal ().Msg ("no init received" )
6980 }
@@ -72,7 +83,9 @@ func handleInit(scanner *bufio.Scanner) {
7283 log .Info ().RawJSON ("line" , []byte (line )).Msg ("Got line" )
7384 reqType , req , _ := parseRequest (line )
7485 if reqType != MsgTypeInit {
75- log .Fatal ().Msg ("unexpected request" )
86+ log .Error ().Interface ("req" , req ).
87+ Msg ("Unexpected request while waiting for init" )
88+ return errors .New ("invalid message type" )
7689 }
7790
7891 init := req .(* Message [Init ])
@@ -94,6 +107,8 @@ func handleInit(scanner *bufio.Scanner) {
94107 InReplyTo : & init .Body .MsgId ,
95108 }},
96109 })
110+
111+ return nil
97112}
98113
99114func main () {
You can’t perform that action at this time.
0 commit comments