Threads for sergeyb

    1. 1

      There is an article, if you are really curious about speeding up your CI.

      1. 1

        There’s some good general info there, but the FactoryBot-specific optimizations in this post are still more relevant.

      2. 2

        It is funny that popular test “bank” was not used for Datomic Pro used in NuBank :)

        1. 3

          Thanks! Some time ago I wrote an arrticle about git notes too - https://github.com/ligurio/testres/wiki/Using-GIT-as-a-storage. It describes using notes as a storage fir testing results. Moreover, I’ve sent a patch for cgit that shows these testing results in web ui.

          1. 4

            The Sail project generated formal specifications of PowerPC by parsing the pseudocode in the PDF architecture references. I think that they found that the x86 docs at the time were too limited (inconsistent and incomplete) to do the same. I’m curious how well this project manages it. Arm eventually moved to auto-generating their pseudocode from their internal Architecture Specification Language (ASL) and there’s a tool that will transform ASL to Sail. The RISC-V official spec now uses Sail as well.

            1. 1

              Seems you are talking about this project, - https://github.com/rems-project/sail. Haven’t heard about it. I didn’t get - is possible to translate assembler instructions to SMT representation (smt-lib2) using Sail?

              1. 4

                Seems you are talking about this project, - https://github.com/rems-project/sail

                Yup.

                I didn’t get - is possible to translate assembler instructions to SMT representation (smt-lib2) using Sail?

                It can prove SMT properties inline and can export to a variety of theorem provers. We used this to prove monotonicity properties about CHERI capabilities, for example.

            2. 5

              See also: ValidAlloy: A tool for validating a git alloy specification using testcase generation. It is an impressive work where model refined using real testcases for real Git implementation.

              1. 3

                Oh wow! Thank you for sharing this. I’m gonna have to read it carefully

              2. 1

                ccache is not a single way to speedup building a project. There are many other possible ways to speedup both building and testing. Most of them we implemented for Tarantool CI and reduced a time required for a feedback. If someone interested, I’ve prepared a list of such improvements in CI.

                1. 2

                  What would you use from that page to speed up a kernel build, except ccache?

                  1. 1
                    • we often use parallel mode in Git (saves seconds)
                    • we use paths-ignore that skips running CI for changes in READMEs and other files that are not checked by jobs in CI
                    • we use caching dependencies (in our case caching installed Lua rocks), for example in cartridge
                    • I’ve used profiling for build system to speedup building in OSS Fuzz, see https://github.com/google/oss-fuzz/commit/17d780c2b1961b089984ed0ee8588cbb1edb2257
                    • we always use parallel mode for Make and Ninja
                    • we always run tests in parallel mode
                    1. 1

                      The only thing applicable for building Linux is parallel builds, and those are already implemented.

                      1. 1

                        Test impact analysis could significantly reduce a total time required for testing a kernel, and it is not implemented.

                            1. 1

                              Those aren’t used for local development.

                2. 1

                  Does anyone here use tarantool? Is there a smooth migration path from Postgres?

                  I ask because I’m currently implementing cubejs as a database cache/acceleration layer. The performance is decent BUT it’s a solution to poll the database for updates and rebuild the cache rather than a write-through solution.

                  1. 1

                    I’m not using Tarantool, but I’m building it.

                    To be honest, Tarantool is not a drop-in replacement for PostgreSQL. Typical Tarantool usecases are cache, queue, sophisticated business logic on top of DB engine. Regarding Postgres - there is a connector to Postgres.

                      1. 1

                        I would recommend joining telegram chat and ask questions there.

                  2. 2

                    I’m polishing my native coverage-guided libFuzzer-based fuzzer for Lua before publishing source code.

                    1. 2

                      I would propose to take a look on CTest. It is a part of CMake and allows running any tests. CTest is a test framework-agnostic tool. CTest allows running tests in parallel, rerun tests failed last time, filter tests by label etc.

                      See documentation for ctest.1 and for add_test.

                      Feel free to ask questions about integration with CTest if you are interested in it.

                      1. 2

                        Valgrind is a nice tool, but AddressSanitizer is 10 times faster than Valgrind.

                        1. 3

                          I’m surprised this is so new, as Lua is now on version 5.4.

                          1. 1

                            Lua 5.1 is actively used, for example LuaJIT still supports 5.1+ partially. See also results of survey - https://docs.google.com/forms/d/1yacI6dj0d9OD8P5nhNp3647amjeVHauCvgVw9K3otFM/viewanalytics

                            Feel free to create manual pages missed for newer Lua versions.

                          2. 5

                            If our history contains many transactions, knossos will be unable to verify linearizability.

                            It is worth to say that Elle is much better than Knossos, it allows checking longer histories.

                            By the way, it is not mandatory to use Jepsen for writing consistency tests. It is possible to make tests in any other programming language, produce a history in Jepsen-compatible and check it with elle-cli, a command-line frontend to transactional consistency checkers for black-box databases.

                            1. 5

                              One thing the author seemingly hasn’t tried is using a manufacturer-independent gateway for Zigbee like https://www.zigbee2mqtt.io. This approach uses a USB-to-Zigbee adapter and makes all Zigbee devices from all vendors talk to each other. Run on a Raspberry Pi together with HomeAssistant (general-purpose home automation) or Homebridge (to bridge to Apple HomeKit), this setup provides a great user experience (for me).

                              It also opens two common and documented APIs for interfacing with the devices: HomeAssistant (high-level) and MQTT (lower-level, still easy).

                              I personally run Zigbee2mqtt with HomeBridge and control everything from the Apple ecosystem. It works flawlessly for me and my family. From the nerd-side, I stream all MQTT messages as JSON to a Postgres database and use Grafana to plot various metrics from sensors and devices.

                              1. 1

                                Personally, I don’t like zigbee2mqtt. However, it is the best solution for vendor-independent gateway. I’m looking on zigbee-lua that uses Lua instead of Javascript and other alternatives.

                                1. 1

                                  I agree - the amount of code and complexity of the Javascript in zigbee2mqtt is staggering. Thanks for pointing me to zigbee-lua - looks great.

                                  In an ideal world, there would be a standardised mqtt protocol definition with zigbee2mqtt and others implementing that protocol. From a short look it’s not entirely clear if zigbee-lua tries to be wire-compatible with zigbee2mqtt.

                                  1. 1

                                    In an ideal world, there would be a standardised mqtt protocol definition with zigbee2mqtt and others implementing that protocol.

                                    Absolutely agree.

                                    1. 1

                                      As far as I get it right, the main complexity of zigbee2mqtt are quirks for different Zigbee devices that doesn’t conform to Zigbee specification. For interaction with Zigbee devices, z2m uses zigbee-herdsman-converters to parse messages to and from devices. Adding support of a new Zigbee device to z2m is actually an implementation of a new converter that understands and processes messages from the new device.

                                      There is alternative of zigbee-herdsman-converters written in Python - zha-device-handlers. It uses zigpy for access to Zigbee messages, and it is used by Zigbee plugin for Home Assistant. zha-device-handlers contains a huge number of quirks for Zigbee devices, see subdirectories in the zhaquirks directory. zha-device-handlers has a great explanation of quirks for Zigbee devices and it is worth to read it - https://github.com/zigpy/zha-device-handlers#what-the-heck-is-a-quirk

                                    2. 1

                                      I’d never heard of zigbee-lua, but it looks pretty stale compared to zigbee2mqtt. I don’t find the implementation language anything more than a implementation detail, especially not when typically running in a container.

                                      I’ve used z2m on a raspberry pi and homeassistant on another. I moved to ZHA (the native Home assistant implementation) only by accident and was too lazy to start over again. But I’ll go back to z2m again after moving houses soon.

                                    3. 1

                                      I have tried using a USB-to-zigbee adapter, but with custom software and not zigbee2mqtt.

                                      Maybe the experience would have been better with zigbee2mqtt, but I generally like building my own stuff. From that perspective, the zigbee stack is not great, and my USB-to-zigbee interfered with the IKEA tradfri gateway pairing process.

                                      I hope more modern smart home standards result in better ecosystems, but I’ll stick to the vendor gateways for now :)

                                      1. 1

                                        The software mine came with was absolutely horrendous - which is usually the case for such systems. I updated the stick’s software and then uninstalled it :-)

                                        The great thing is, that Zigbee2mqtt makes building your own stuff incredibly nice - you just start at a different level - MQTT instead of the stick’s serial interface. Zigbee2mqtt is the gateway and provides an API (via MQTT) to control devices in your Zigbee network.

                                        That it will interfere with other gateway’s when both are open for devices to join is expected - but that’s expected. Multiple separate zigbee networks in the same house work fine. Devices just get confused which network to join when multiple gateways are in pairing mode.

                                        In my use case the only gateway used is the usb stick used by zigbee2mqtt, which removes the need for all other Gateways, thus freeing you from having to use a different gateway for each vendor, and putting you much more in control of the stack.

                                        1. 1

                                          Well, there’s always Matter which should come out sometime this year. I’ll keep on using Home Assistant until Matter makes sense to switch to - and then maybe. Home Assistant is pretty nice, not having to care what ecosystem my stuff is in and just interact with all of them instead.

                                      2. 1

                                        I’ll discuss GSoC task with a student in a mentor role. We plan to implement a fuzzer for Lua interpreters (especially LuaJIT).

                                        1. 3

                                          It’s inconvenient to actually create actual filesystems with no space left, or disks the actually fail.

                                          it’s worth use an existed fault injection filesystem like unreliablefs.

                                          1. 2

                                            its easily possible to simulate faulty disks using dm-setup on linux, see: https://abbbi.github.io/dd/

                                            1. 2

                                              Right. Except dd(1) and unreliablefs there are many other tools for injecting faults. See a diagram.

                                          2. 5

                                            Thanks! Added it to the list with ASCII games.

                                            1. 2

                                              I plan to make a first release of elle-cli, command line transactional safety checker based on Jepsen, Elle and Knossos. I would like to hear any feedback from everyone who involved in testing of distributed systems or DBMS.

                                              1. 1

                                                I like the idea! I am not sure how to use it.

                                              2. 2
                                                1. 1

                                                  Thanks, didn’t know about it. I made unreliablefs agnostic for operating systems and it has a single dependence - the FUSE library, that exists almost everywhere.

                                                2. 3

                                                  To be honest, this is not the first FUSE-based filesystem with fault injection, but other implementations do not match my requirements. I wanted an easy way to manage configuration at runtime, so I added an INI-like config file that is re-read on every change, and some specific error injection, such as setting real errors for the file operations being performed.