dongmao7195 2014-05-12 23:07
浏览 24
已采纳

在测试期间控制最终的AppEngine数据存储区一致性

I have an AppEngine app written in Go, and I'm trying to improve my tests.

Part of the tests that I need to run are a series of create, update, delete queries on the same object. However given that the datastore is eventually consistent (these aren't child objects), I am currently stuck using a time.Sleep(time.Second * 5) to give the simulated datastore in the SDK enough time for consistency to propagate.

This results in tests that take a long time to run. How can I force something more like strong consistency for tests without rewriting my code to use ancestor queries?

  • 写回答

2条回答 默认 最新

  • duanniu4106 2015-09-22 14:27
    关注

    It's been a while, but the method that I found that works well is to call the context as follows:

    c, err := aetest.NewContext(&aetest.Options{StronglyConsistentDatastore: true})

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥20 基于MSP430f5529的MPU6050驱动,求出欧拉角
  • ¥20 Java-Oj-桌布的计算
  • ¥15 请问如何在openpcdet上对KITTI数据集的测试集进行结果评估?
  • ¥15 powerbuilder中的datawindow数据整合到新的DataWindow
  • ¥20 有人知道这种图怎么画吗?
  • ¥15 pyqt6如何引用qrc文件加载里面的的资源
  • ¥15 安卓JNI项目使用lua上的问题
  • ¥20 RL+GNN解决人员排班问题时梯度消失
  • ¥60 要数控稳压电源测试数据
  • ¥15 能帮我写下这个编程吗