Skip to content

Commit

Permalink
Fixes to make ci happy
Browse files Browse the repository at this point in the history
  • Loading branch information
FedericoPonzi committed Feb 12, 2024
1 parent 33ac3e1 commit f7ff911
Show file tree
Hide file tree
Showing 12 changed files with 33 additions and 18 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,6 @@

# Get TLA⁺ tools
wget -nv http://nightly.tlapl.us/dist/tla2tools.jar -P "."
# Get TLA⁺ community modules
wget -nv https://github.com/tlaplus/CommunityModules/releases/latest/download/CommunityModules-deps.jar \
-O "."
24 changes: 20 additions & 4 deletions .github/workflows/wrapper.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,24 @@
#!/usr/bin/env bash
set -e
# A small wrapper around TLC
TLC_PATH=$1

TLC_COMMAND="java -Dtlc2.TLC.stopAfter=180 -Dtlc2.TLC.ide=Github -Dutil.ExecutionStatisticsCollector.id=abcdef60f238424fa70d124d0c77ffff -cp tla2tools.jar tlc2.TLC -workers auto -lncheck final -tool -deadlock"
find . -mindepth 1 -maxdepth 1 -type d '!' -exec test -e "{}/.ciignore" ';' -print | grep -v ".git" | xargs -n 1 "$TLC_COMMAND"
# Add .ciignore file in a directory to ignore it.

tlc="java -Dtlc2.TLC.stopAfter=180 \
-Dtlc2.TLC.ide=Github \
-Dutil.ExecutionStatisticsCollector.id=abcdef60f238424fa70d124d0c77ffff \
-XX:+UseParallelGC \
-cp "tla2tools.jar:CommunityModules-deps.jar" tlc2.TLC \
-workers auto \
-lncheck final \
-tool -modelcheck"

find . -mindepth 1 -maxdepth 1 -type d '!' -exec test -e "{}/.ciignore" ';' -print | grep -v ".git" | while read -r dir; do
echo "Running $dir"
cd $dir
cfg_file=$(find "." -maxdepth 1 -type f -name "*.cfg" -print -quit)
tla_file=${cfg_file/.cfg/.tla}
($tlc -config "$cfg_file" "$tla_file")
cd ../
echo "Finished checking $dir"
done
echo "Completed successfully."
4 changes: 2 additions & 2 deletions 2-phase-commit/2pc.tla
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ RM:

}
*)
\* BEGIN TRANSLATION (chksum(pcal) = "3f73e87b" /\ chksum(tla) = "ad96144a")
\* BEGIN TRANSLATION (chksum(pcal) = "c33de399" /\ chksum(tla) = "3f28490e")
VARIABLES resourceManagerState, tmState, pc

(* define statement *)
Expand All @@ -72,7 +72,7 @@ CanCommit == \A rm \in ResourceManagers :
CanAbort == \A rm \in ResourceManagers :
resourceManagerState[rm] = StateAborted
Inv == /\ \E rm1 \in ResourceManagers: resourceManagerState[rm1] \in {StateCommitted} => ~ \E rm2 \in ResourceManagers : resourceManagerState[rm2] \in {StateAborted}
/\ baitinv


Terminate == \A rm \in ResourceManagers: resourceManagerState[rm] \in {StateCommitted, StateAborted}

Expand Down
Empty file added chain-replication/.ciignore
Empty file.
Empty file added lease-buggy-code/.ciignore
Empty file.
17 changes: 6 additions & 11 deletions lease-buggy-code/lease.tla
Original file line number Diff line number Diff line change
Expand Up @@ -54,47 +54,42 @@ States == {StatesSleep, StatesWaitingLease, StatesDoingOperation, StatesRenewedL
variables states = [x \in Workers |-> StatesWaitingLease];
define {
OnlyOneLeader == Cardinality({w \in DOMAIN (states): states[w] = StatesDoingOperation}) <= 1
TypeOk == \A w \in Workers: states[w] \in States
TypeOk == \A w \in Workers: states[w] \in States
Inv == /\ TypeOk
/\ OnlyOneLeader
\*/\ baitinv
}

macro stateIs(s) {
states[self] = s
}

process (w \in Workers) {
W:
while(TRUE) {
either {
\* If lease is expired, renew
await stateIs(StatesWaitingLease)
await states[self] = StatesWaitingLease;
await ~\E w \in Workers : states[w] = StatesDoingOperation \/ states[w] = StatesRenewedLease;
states[self] := StatesRenewedLease;
} or {
\* Leader goes to sleep before start operation
await stateIs(StatesRenewedLease);
await states[self] = StatesRenewedLease;
\* this state is like saying that lease is expired.
states[self] := StatesSleep;
} or {
\* Leader start the operation
await stateIs(StatesRenewedLease) \/ stateIs(StatesSleep);
await states[self] = StatesRenewedLease \/ states[self] = StatesSleep;
states[self] := StatesDoingOperation;
} or {
\* Leader has completed the operation, no goes through the renew lease phase.
await stateIs(StatesDoingOperation);
await states[self] = StatesDoingOperation;
states[self] := StatesWaitingLease;
}
}
}
}*)
\* BEGIN TRANSLATION (chksum(pcal) = "92808600" /\ chksum(tla) = "8f5050cf")
\* BEGIN TRANSLATION (chksum(pcal) = "a482c2a" /\ chksum(tla) = "8f5050cf")
VARIABLE states

(* define statement *)
OnlyOneLeader == Cardinality({w \in DOMAIN (states): states[w] = StatesDoingOperation}) <= 1

TypeOk == \A w \in Workers: states[w] \in States
Inv == /\ TypeOk
/\ OnlyOneLeader
Expand Down
2 changes: 1 addition & 1 deletion logical-clocks-and-mutual-exclusion/lamport_clock.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ SPECIFICATION Spec

CONSTANTS
Processes = {0, 1}
ProcessCanFail = TRUE
ProcessCanFail = FALSE
MaxTimestamp = 15
INVARIANT
Inv
Expand Down
1 change: 1 addition & 0 deletions missionaries_and_cannibals_problem/.ciignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

Empty file added raft/.ciignore
Empty file.
Empty file added voldemort-storage/.ciignore
Empty file.
Empty file added weeks_of_debugging/.ciignore
Empty file.
Empty file added wolf_goat_cabbage/.ciignore
Empty file.

0 comments on commit f7ff911

Please sign in to comment.